]> pd.if.org Git - pdclib/blobdiff - functions/stdio/vsscanf.c
Intermediate debugging work on *scanf().
[pdclib] / functions / stdio / vsscanf.c
index 34397ac36407834ff02f63b16de83190fc4db493..fd35889ab4d200ead2782f2a1e732c9b76fc97a7 100644 (file)
@@ -59,6 +59,16 @@ int vsscanf( const char * _PDCLIB_restrict s, const char * _PDCLIB_restrict form
         }
         else
         {
+            /* NULL return code indicates input error */
+            if ( rc == NULL )
+            {
+                if ( status.n == 0 )
+                {
+                    /* input error before any conversion returns EOF */
+                    status.n = EOF;
+                }
+                break;
+            }
             /* Continue parsing after conversion specifier */
             format = rc;
         }