From: Rich Felker Date: Sat, 13 Jun 2015 04:42:38 +0000 (+0000) Subject: add printing of null %s arguments as "(null)" in wide printf X-Git-Tag: v1.1.11~46 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f8f565df467c13248104223f99abf7f37cef7584;p=oweals%2Fmusl.git add printing of null %s arguments as "(null)" in wide printf this is undefined, but supported in our implementation of the normal printf, so for consistency the wide variant should support it too. --- diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index 281f4e56..deff9828 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -296,6 +296,7 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ case 'm': arg.p = strerror(errno); case 's': + if (!arg.p) arg.p = "(null)"; bs = arg.p; if (p<0) p = INT_MAX; for (i=l=0; l

0; bs+=i, l++);