summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-07-04 01:01:58 -0400
committerRich Felker <dalias@aerifal.cx>2011-07-04 01:01:58 -0400
commit3d54adbe4752f3aaa61a1be412b6116ff7dd5be1 (patch)
tree61836b5e6111e8284adbb0743d347763a938f5b9
parent2f0c415cebfedff0e4eb49b743a591a4c15d454e (diff)
downloadmusl-3d54adbe4752f3aaa61a1be412b6116ff7dd5be1.tar.gz
musl-3d54adbe4752f3aaa61a1be412b6116ff7dd5be1.tar.bz2
musl-3d54adbe4752f3aaa61a1be412b6116ff7dd5be1.tar.xz
musl-3d54adbe4752f3aaa61a1be412b6116ff7dd5be1.zip
printf("%#x",0) should print 0 not 0x0
-rw-r--r--src/stdio/vfprintf.c2
1 files changed, 1 insertions, 1 deletions
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);