X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fstdio%2Fvfwprintf.c;h=c6400591a01ac7d6e257721eb0ed19b4f3a5a556;hb=984c25b74da085c6ae6b44a87bbd5f8afc9be331;hp=3557678f455d0189a169e5589b52c143e2d0b5b5;hpb=a938b5a12d7a68d45f4549bca670d8941304e750;p=oweals%2Fmusl.git diff --git a/src/stdio/vfwprintf.c b/src/stdio/vfwprintf.c index 3557678f..c6400591 100644 --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -253,7 +253,6 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ /* Check validity of argument type (nl/normal) */ if (st==NOARG) { if (argpos>=0) return -1; - else if (!f) continue; } else { if (argpos>=0) nl_type[argpos]=st, arg=nl_arg[argpos]; else if (f) pop_arg(&arg, st, ap); @@ -287,8 +286,7 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ case 'S': a = arg.p; z = wmemchr(a, 0, p); - if (!z) z=a+p; - else p=z-a; + if (z) p=z-a; if (wmode |= f->mode+1; ret = wprintf_core(f, fmt, &ap2, nl_arg, nl_type); FUNLOCK(f); va_end(ap2);