From cc44d9f2017855ad29c5c1301e8368158a4c2fa7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 4 Jul 2011 01:57:00 -0400 Subject: [PATCH] zero precision with zero value should not inhibit prefix/width printing --- src/stdio/vfprintf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 2c4fdf3d..67660121 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -570,7 +570,10 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, case 'u': a = fmt_u(arg.i, z); } - if (!arg.i && !p) continue; + if (!arg.i && !p) { + a=z; + break; + } if (p>=0) fl &= ~ZERO_PAD; p = MAX(p, z-a + !arg.i); break; -- 2.20.1