From 8b02a71f53d75bd679c46141a0a2a8f8b26aef19 Mon Sep 17 00:00:00 2001 From: Manuel Novoa III Date: Fri, 6 Sep 2002 15:34:42 +0000 Subject: =?UTF-8?q?Patch=20from=20Tero=5FLyytik=EF=BF=BDinen=20=20to=20fix=20bug=20in=20matchchar=20case.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libc/stdio/scanf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libc/stdio/scanf.c') diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 7ebde12ea..7c316cdf8 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -29,6 +29,9 @@ * * So uClibc's *scanf functions conform to the standard, and glibc's * implementation doesn't for the "100ergs" case mentioned above. + * + * Sep 6, 2002 + * Patch from Tero_Lyytikäinen to fix bug in matchchar case. */ #define _ISOC99_SOURCE /* for LLONG_MAX primarily... */ @@ -581,6 +584,7 @@ int vfscanf(FILE *fp, const char *format, va_list ap) } else { /* Match the current fmt char. */ matchchar: if (scan_getc_nw(&sc) != *fmt) { + scan_ungetc(&sc); goto done; } scan_getc_nw(&sc); -- cgit v1.2.3