X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Fvfwscanf.c;h=b3bc6f3a285ee0a2339aae41d200a15ad4b27b01;hb=b0302863a36ef6ad24bd25e3ef4df74b9a56980d;hp=a52ba3a07099bc5bb003f63c0ccbd1bb0dd4b840;hpb=9ab180fa57f3a01b2004c3d19ad8dc3732f6069d;p=musl diff --git a/src/stdio/vfwscanf.c b/src/stdio/vfwscanf.c index a52ba3a0..b3bc6f3a 100644 --- a/src/stdio/vfwscanf.c +++ b/src/stdio/vfwscanf.c @@ -86,7 +86,7 @@ static int in_set(const wchar_t *set, int c) ((f)->rend && (c)<128U ? *--(f)->rpos : ungetwc((c),(f))) #endif -int vfwscanf(FILE *f, const wchar_t *fmt, va_list ap) +int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap) { int width; int size; @@ -181,8 +181,11 @@ int vfwscanf(FILE *f, const wchar_t *fmt, va_list ap) /* Transform ls,lc -> S,C */ if (size==SIZE_l && (t&15)==3) t&=~32; - if (t != 'n' && t != '[' && (t|32) != 'c') { - while (iswspace((c=getwc(f)))) pos++; + if (t != 'n') { + if (t != '[' && (t|32) != 'c') + while (iswspace((c=getwc(f)))) pos++; + else + c=getwc(f); if (c < 0) goto input_fail; ungetwc(c, f); }