mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-10 00:32:27 +03:00
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.
This commit is contained in:
parent
f9e25d8138
commit
f8f565df46
@ -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<p && (i=mbtowc(&wc, bs, MB_LEN_MAX))>0; bs+=i, l++);
|
||||
|
Loading…
Reference in New Issue
Block a user