فهرست منبع

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

Dmitry-Me 10 سال پیش
والد
کامیت
96b110d25e
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      tinyxml2.cpp

+ 1 - 0
tinyxml2.cpp

@@ -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