From: Rich Felker Date: Fri, 16 Sep 2016 21:40:08 +0000 (-0400) Subject: fix printf regression with alt-form octal, zero flag, and field width X-Git-Tag: v1.1.16~71 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0;p=oweals%2Fmusl.git fix printf regression with alt-form octal, zero flag, and field width commit b91cdbe2bc8b626aa04dc6e3e84345accf34e4b1, in fixing another issue, changed the logic for how alt-form octal adds the leading zero to adjust the precision rather than using a prefix character. this wrongly suppressed the zero flag by mimicing an explicit precision given by the format string. switch back to using a prefix character. based on bug report and patch by Dmitry V. Levin, but simplified. --- diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 2ecf7692..e439a07a 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -570,7 +570,7 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, if (0) { case 'o': a = fmt_o(arg.i, z); - if ((fl&ALT_FORM) && p