Another fix to warning

master
Tomasz Kapuściński 2015-05-19 17:24:07 +02:00
parent 3a1dffd8df
commit 361a8c4ddd
1 changed files with 14 additions and 13 deletions

View File

@ -3626,9 +3626,10 @@ bool CScriptFunctions::rfread (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult,
int i;
for (i = 0; i < 2000; i++) chaine[i] = 0;
(void) fgets(chaine, 1999, pFile);
if (fgets(chaine, 1999, pFile) != nullptr)
{
for (i = 0; i < 2000; i++) if (chaine[i] == '\n') chaine[i] = 0;
}
// if an error occurs generate an exception
if ( ferror(pFile) ) { Exception = CBotErrRead; return false; }