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

View file

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