about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-07-04 11:55:52 -0400
committerRich Felker <dalias@aerifal.cx>2011-07-04 11:55:52 -0400
commita9e6d01114c8b4aa264d5d49aa26de8bda2c76be (patch)
tree3fb85c8ad1e7934088b62e8365d9478dbe2167dd
parentcc44d9f2017855ad29c5c1301e8368158a4c2fa7 (diff)
downloadmusl-a9e6d01114c8b4aa264d5d49aa26de8bda2c76be.tar.gz
musl-a9e6d01114c8b4aa264d5d49aa26de8bda2c76be.tar.xz
musl-a9e6d01114c8b4aa264d5d49aa26de8bda2c76be.zip
printf: "if a precision is specified, the '0' flag shall be ignored."
-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 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':