CID 22436 Ignoring number of bytes read

This commit is contained in:
Enno Rehling 2015-11-04 11:46:57 +01:00
parent 731dac3363
commit 3fe7b94cc7
1 changed files with 2 additions and 2 deletions

View File

@ -1409,8 +1409,8 @@ int readgame(const char *filename, bool backup)
fread(&gdata.version, sizeof(int), 1, F);
if (gdata.version >= INTPAK_VERSION) {
int stream_version;
fread(&stream_version, sizeof(int), 1, F);
assert(stream_version == STREAM_VERSION || !"unsupported data format");
size_t sz = fread(&stream_version, sizeof(int), 1, F);
assert((sz==1 && stream_version == STREAM_VERSION) || !"unsupported data format");
}
assert(gdata.version >= MIN_VERSION || !"unsupported data format");
assert(gdata.version <= MAX_VERSION || !"unsupported data format");