X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fvfwscanf.c;h=a7cd09231a311f2a4abc8dba4cd5a3921ff65bc1;hb=2fab90a71acd3698954c08b9062db67188443dd7;hp=1ebc5cef51882c822e29b2642dc42de705a3a342;hpb=733d1ea759119bcd0554f25034d1b4113b910900;p=musl diff --git a/src/stdio/vfwscanf.c b/src/stdio/vfwscanf.c index 1ebc5cef..a7cd0923 100644 --- a/src/stdio/vfwscanf.c +++ b/src/stdio/vfwscanf.c @@ -117,8 +117,12 @@ int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap) continue; } if (*p != '%' || p[1] == '%') { - p += *p=='%'; - c = getwc(f); + if (*p == '%') { + p++; + while (iswspace((c=getwc(f)))) pos++; + } else { + c = getwc(f); + } if (c!=*p) { ungetwc(c, f); if (c<0) goto input_fail;