From: solar Date: Thu, 1 Oct 2009 05:44:07 +0000 (+0000) Subject: Proper handling of NULL return code. X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a8cf4a3b179974105bca3a354d6789120d961a1e;p=fw%2Fpdclib Proper handling of NULL return code. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@378 546481bc-9713-0410-bf18-d3337bbf4a3e --- diff --git a/functions/stdio/vfscanf.c b/functions/stdio/vfscanf.c index eda4226..0667c99 100644 --- a/functions/stdio/vfscanf.c +++ b/functions/stdio/vfscanf.c @@ -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; } diff --git a/functions/stdio/vsscanf.c b/functions/stdio/vsscanf.c index 34397ac..f33b8c4 100644 --- a/functions/stdio/vsscanf.c +++ b/functions/stdio/vsscanf.c @@ -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; }