Assert to ensure ftell() behaves as expected by later code

This commit is contained in:
Dmitry-Me 2016-02-09 15:12:40 +03:00
parent 9ff6654174
commit 96b110d25e
1 changed files with 1 additions and 0 deletions

View File

@ -1954,6 +1954,7 @@ XMLError XMLDocument::LoadFile( FILE* fp )
SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );
return _errorID;
}
TIXMLASSERT( filelength >= 0 );
if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) {
// Cannot handle files which won't fit in buffer together with null terminator