tighten up the error checks

This commit is contained in:
Lee Thomason
2015-05-22 11:00:32 -07:00
parent 2ecc203835
commit 7a93b33160
2 changed files with 3 additions and 3 deletions

View File

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