diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/stdio/vfscanf.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index 64768bb8cc7..0a39d8fd0e4 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.5 1998/01/19 19:40:12 millert Exp $"; +static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.6 1998/01/20 21:25:39 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -128,18 +128,9 @@ __svfscanf(fp, fmt0, ap) if (c == 0) return (nassigned); if (isspace(c)) { - for (;;) { - if (fp->_r <= 0 && __srefill(fp)) { - while (isspace(*fmt)) - fmt++; - if (*fmt == '%' && *(fmt + 1) == 'n') - break; - return (nassigned); - } - if (!isspace(*fp->_p)) - break; + while ((fp->_r > 0 || __srefill(fp) == 0) && + isspace(*fp->_p)) nread++, fp->_r--, fp->_p++; - } continue; } if (c != '%') |