Subject: vfscanf()
To: None <current-users@NetBSD.ORG>
From: None <friedl@informatik.uni-kl.de>
List: current-users
Date: 07/06/1995 14:57:41
When scanf() is called at enf-of-file with a format string containing
a space, scanf returns 0.  Some programs expect scanf() to return EOF
in this case.

This is changed by the following patch.

--- lib/libc/stdio/vfscanf.c~	Wed Mar 22 12:00:53 1995
+++ lib/libc/stdio/vfscanf.c	Fri Jun  9 17:00:40 1995
@@ -135,7 +135,7 @@
 		if (isspace(c)) {
 			for (;;) {
 				if (fp->_r <= 0 && __srefill(fp))
-					return (nassigned);
+					goto input_failure;
 				if (!isspace(*fp->_p))
 					break;
 				nread++, fp->_r--, fp->_p++;