提交 a9e6d011 编写于 作者: R Rich Felker

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

上级 cc44d9f2
...@@ -570,11 +570,11 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, ...@@ -570,11 +570,11 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
case 'u': case 'u':
a = fmt_u(arg.i, z); a = fmt_u(arg.i, z);
} }
if (p>=0) fl &= ~ZERO_PAD;
if (!arg.i && !p) { if (!arg.i && !p) {
a=z; a=z;
break; break;
} }
if (p>=0) fl &= ~ZERO_PAD;
p = MAX(p, z-a + !arg.i); p = MAX(p, z-a + !arg.i);
break; break;
case 'c': case 'c':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册