From: Rich Felker Date: Wed, 16 Mar 2016 20:35:22 +0000 (-0400) Subject: fix padding string formats to width in wide printf variants X-Git-Tag: v1.1.15~83 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4aac019a0efd59011a48d031ad046c934c7e8365;p=oweals%2Fmusl.git fix padding string formats to width in wide printf variants the idiom fprintf(f, "%.*s", n, "") was wrongly used in vfwprintf as a means of producing n spaces; instead it produces no output. the correct form is fprintf(f, "%*s", n, ""), using width instead of precision, since for %s the later is a maximum rather than a minimum. --- diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index f06d5aed..f9f1ecfd 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -288,9 +288,9 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ z = wmemchr(a, 0, p); if (z) p=z-a; if (w