X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdio%2Fvfscanf.c;h=b9a6896ed7a54381b9e95a692486a3e881db0304;hp=fbf5356d78673667b741fca010ea4af5cfc9adbe;hb=dd71cbbfbd68cd8c653277a0c1f70ab2b179421c;hpb=bdad1f82d0c0aa0b83e8b195303d7957c578da2e diff --git a/functions/stdio/vfscanf.c b/functions/stdio/vfscanf.c index fbf5356..b9a6896 100644 --- a/functions/stdio/vfscanf.c +++ b/functions/stdio/vfscanf.c @@ -42,7 +42,7 @@ int vfscanf( FILE * _PDCLIB_restrict stream, const char * _PDCLIB_restrict forma { ++status.i; } - if ( ! feof( stream ) ) /* TODO: Check EOF status directly */ + if ( ! feof( stream ) ) { ungetc( c, stream ); } @@ -50,10 +50,10 @@ int vfscanf( FILE * _PDCLIB_restrict stream, const char * _PDCLIB_restrict forma else { /* Non-whitespace char in format string: Match verbatim */ - if ( ( ( c = getc( stream ) ) != *format ) || feof( stream ) ) /* TODO: Check EOF status directly */ + if ( ( ( c = getc( stream ) ) != *format ) || feof( stream ) ) { /* Matching error */ - if ( ! feof( stream ) && ! ferror( stream ) ) /* TODO: Check EOF status directly */ + if ( ! feof( stream ) && ! ferror( stream ) ) { ungetc( c, stream ); }