From: Rich Felker Date: Mon, 4 Jul 2011 05:01:58 +0000 (-0400) Subject: printf("%#x",0) should print 0 not 0x0 X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=commitdiff_plain;h=3d54adbe4752f3aaa61a1be412b6116ff7dd5be1 printf("%#x",0) should print 0 not 0x0 --- diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index f13fbe10..2c4fdf3d 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -552,7 +552,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, fl |= ALT_FORM; case 'x': case 'X': a = fmt_x(arg.i, z, t&32); - if (fl & ALT_FORM) prefix+=(t>>4), pl=2; + if (arg.i && (fl & ALT_FORM)) prefix+=(t>>4), pl=2; if (0) { case 'o': a = fmt_o(arg.i, z);