Merge pull request #191 from Dmitry-Me/dontIgnoreFgetcReturnValue

fgetc() is not required to clear the error indicator on success
This commit is contained in:
Lee Thomason 2014-08-03 11:17:04 -07:00
commit fca00d0ebc
1 changed files with 1 additions and 2 deletions

View File

@ -1689,8 +1689,7 @@ XMLError XMLDocument::LoadFile( FILE* fp )
Clear();
fseek( fp, 0, SEEK_SET );
fgetc( fp );
if ( ferror( fp ) != 0 ) {
if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) {
SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );
return _errorID;
}