Error case if game num can't be read in cheatsImportGSACodeFile

Silence GCC warning
This commit is contained in:
Mystro256 2017-02-12 01:10:54 -05:00 committed by Rafael Kitover
parent 7e8efe963f
commit b38cb9b522
1 changed files with 7 additions and 2 deletions

View File

@ -2040,9 +2040,14 @@ bool cheatsImportGSACodeFile(const char* name, int game, bool v3)
return false;
int games = 0;
int len = 0;
fseek(f, 0x1e, SEEK_CUR);
fread(&games, 1, 4, f);
if(fread(&games, 1, 4, f) == 0)
{
fclose(f);
return false;
}
int len = 0;
bool found = false;
int g = 0;
while (games > 0) {