summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/vfscanf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index c0ad92062d4..64768bb8cc7 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.4 1997/07/25 20:30:13 mickey Exp $";
+static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.5 1998/01/19 19:40:12 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -129,8 +129,13 @@ __svfscanf(fp, fmt0, ap)
return (nassigned);
if (isspace(c)) {
for (;;) {
- if (fp->_r <= 0 && __srefill(fp))
+ if (fp->_r <= 0 && __srefill(fp)) {
+ while (isspace(*fmt))
+ fmt++;
+ if (*fmt == '%' && *(fmt + 1) == 'n')
+ break;
return (nassigned);
+ }
if (!isspace(*fp->_p))
break;
nread++, fp->_r--, fp->_p++;