]> pd.if.org Git - pdclib/commitdiff
Proper handling of NULL return code.
authorsolar <unknown>
Thu, 1 Oct 2009 05:44:07 +0000 (05:44 +0000)
committersolar <unknown>
Thu, 1 Oct 2009 05:44:07 +0000 (05:44 +0000)
functions/stdio/vfscanf.c
functions/stdio/vsscanf.c

index eda4226988d9c2b6222f624a613563331790accd..0667c990828f7757c124da7b5257faf42b4a47e9 100644 (file)
@@ -59,6 +59,11 @@ int vfscanf( FILE * _PDCLIB_restrict stream, const char * _PDCLIB_restrict forma
         }
         else
         {
+            /* NULL return code indicates matching error */
+            if ( rc == NULL )
+            {
+                break;
+            }
             /* Continue parsing after conversion specifier */
             format = rc;
         }
index 34397ac36407834ff02f63b16de83190fc4db493..f33b8c418e6e9d8a12d3cbcd2ee955f9b0c85ed9 100644 (file)
@@ -59,6 +59,11 @@ int vsscanf( const char * _PDCLIB_restrict s, const char * _PDCLIB_restrict form
         }
         else
         {
+            /* NULL return code indicates matching error */
+            if ( rc == NULL )
+            {
+                break;
+            }
             /* Continue parsing after conversion specifier */
             format = rc;
         }