commit | 08e7f7be59d1f026bd91dffa47f0307c180a2df6 | [log] [tgz] |
---|---|---|
author | Dmitry-Me <wipedout@yandex.ru> | Thu Jul 31 15:19:14 2014 +0400 |
committer | Dmitry-Me <wipedout@yandex.ru> | Thu Jul 31 15:19:14 2014 +0400 |
tree | af186bef65e4f83c4e3964bf22fe701c8eb414d1 | |
parent | 84bd9624c631d69f2232742988c8a1420b2e832d [diff] [blame] |
fgetc() is not required to clear the error indicator on success
diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 927ec6f..25691b9 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp
@@ -1689,8 +1689,7 @@ 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; }