X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Fvfscanf.c;h=d8f9ae6ba404ed56d67ed9e9b76a786780623ffb;hp=62bf47f698857f4c4852783638aa0697c96a7c14;hb=1ab59de81e94e7802f85d314a709f8350a0e9b65;hpb=f18846dd3a048598676e10b2a7b9f931bb3d1d6a;ds=sidebyside diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c index 62bf47f6..d8f9ae6b 100644 --- a/src/stdio/vfscanf.c +++ b/src/stdio/vfscanf.c @@ -169,32 +169,22 @@ int vfscanf(FILE *restrict f, const char *restrict fmt, va_list ap) t = *p; - switch (t) { - case 'C': - if (width < 1) width = 1; - case 'S': + /* C or S */ + if ((t&0x2f) == 3) { t |= 32; size = SIZE_l; - break; + } + + switch (t) { case 'c': if (width < 1) width = 1; - case 'd': case 'i': case 'o': case 'u': case 'x': - case 'a': case 'e': case 'f': case 'g': - case 'A': case 'E': case 'F': case 'G': case 'X': - case '[': case 's': - case 'p': case 'n': + case '[': break; - default: - goto fmt_fail; - } - - if (t == 'n') { + case 'n': store_int(dest, size, pos); /* do not increment match count, etc! */ continue; - } - - if (t != '[' && (t|32) != 'c') { + default: shlim(f, 0); while (isspace(shgetc(f))); shunget(f);