Mail Archives: djgpp-workers/1996/04/01/06:48:58
... and this patch should fix another bug which caused scanf family
to ignore errors in fields parsing. Excuse me for two separate patches :-)
--- doscan.c~~ Mon Apr 1 14:49:48 1996
+++ doscan.c Mon Apr 1 15:19:38 1996
@@ -103,12 +103,17 @@
if (ch == '\0')
return(-1);
if (_innum(ptr, ch, len, size, iop, scan_getc, scan_ungetc,
- &fileended) && ptr)
- nmatch++;
-/* breaks %n */
-/* if (fileended) {
- return(nmatch? nmatch: -1);
- } */
+ &fileended))
+ {
+ if (ptr)
+ nmatch++;
+ }
+ else
+ {
+ if (fileended && nmatch==0)
+ return(-1);
+ return(nmatch);
+ }
break;
case ' ':
case '\n':
- Raw text -