libcflat: fix padding in printf
A simple test:
printf(".%8p.\n", (void *)0);
printf(".%-8p.\n", (void *)0);
printf(".%8p.\n", (void *)1);
printf(".%-8p.\n", (void *)1);
printf(".%8p.\n", (void *)0x123456);
printf(".%-8p.\n", (void *)0x123456);
printf(".%2p.\n", (void *)0);
printf(".%-2p.\n", (void *)0);
printf(".%2p.\n", (void *)1);
printf(".%-2p.\n", (void *)1);
glibc:
. (nil).
.(nil) .
. 0x1.
.0x1 .
.0x123456.
.0x123456.
.(nil).
.(nil).
.0x1.
.0x1.
before patch:
. 0x 0.
.0x 0 .
. 0x 1.
.0x 1 .
. 0x 123456.
.0x 123456 .
.0x 0.
.0x0 .
.0x 1.
.0x1 .
after patch:
. 0.
.0 .
. 0x1.
.0x1 .
.0x123456.
.0x123456.
. 0.
.0 .
.0x1.
.0x1.
(nil) would be possible with a small change, but the standard leaves it
to the implementation and 0 is acceptable, IMO.
Signed-off-by:
Radim Krčmář <rkrcmar@redhat.com>
Please register or sign in to comment