printf: "if a precision is specified, the '0' flag shall be ignored."

This commit is contained in:
Rich Felker 2011-07-04 11:55:52 -04:00
parent cc44d9f201
commit a9e6d01114
1 changed files with 1 additions and 1 deletions

View File

@ -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':