X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Fvfscanf.c;h=b9a6896ed7a54381b9e95a692486a3e881db0304;hb=df85774c4417c5852610d83836b5ec095ebed667;hp=fbf5356d78673667b741fca010ea4af5cfc9adbe;hpb=a99b4a94505bb850207c7370ade46cba99712023;p=pdclib.old 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 ); }