mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-07-07 13:45:56 +00:00
Merge pull request #410 from Dmitry-Me/assertForFTellReturn
Assert to ensure ftell() behaves as expected by later code
This commit is contained in:
commit
c8dad95d44
@ -1954,6 +1954,7 @@ XMLError XMLDocument::LoadFile( FILE* fp )
|
|||||||
SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );
|
SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );
|
||||||
return _errorID;
|
return _errorID;
|
||||||
}
|
}
|
||||||
|
TIXMLASSERT( filelength >= 0 );
|
||||||
|
|
||||||
if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) {
|
if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) {
|
||||||
// Cannot handle files which won't fit in buffer together with null terminator
|
// Cannot handle files which won't fit in buffer together with null terminator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user