From a9e6d01114c8b4aa264d5d49aa26de8bda2c76be Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 4 Jul 2011 11:55:52 -0400 Subject: printf: "if a precision is specified, the '0' flag shall be ignored." --- src/stdio/vfprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 67660121..4c990e5e 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -570,11 +570,11 @@ 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 (p>=0) fl &= ~ZERO_PAD; if (!arg.i && !p) { a=z; break; } - if (p>=0) fl &= ~ZERO_PAD; p = MAX(p, z-a + !arg.i); break; case 'c': -- cgit v1.2.3-70-g09d2