From: Rich Felker Date: Fri, 8 Jun 2012 02:52:41 +0000 (-0400) Subject: fix scanf bug reading literals after width-limited field X-Git-Tag: v0.9.2~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31eaad4796b9da459b15da70097c2b619fb01ea9;p=musl fix scanf bug reading literals after width-limited field the field width limit was not being cleared before reading the literal, causing spurious failures in scanf in cases like "%2d:" scanning "00:". --- diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c index 64fa9754..61b0edb1 100644 --- a/src/stdio/vfscanf.c +++ b/src/stdio/vfscanf.c @@ -103,6 +103,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap) } if (*p != '%' || p[1] == '%') { p += *p=='%'; + shlim(f, 0); c = shgetc(f); if (c!=*p) { shunget(f);