Use fread return values for apply patch error checking
Silences gcc warnings
This commit is contained in:
parent
a493e0f85a
commit
cc2fabbf0a
|
@ -356,8 +356,8 @@ static bool patchApplyPPF2(FILE* f, uint8_t** rom, int* size)
|
||||||
uint8_t* mem = *rom;
|
uint8_t* mem = *rom;
|
||||||
|
|
||||||
uint8_t block[1024];
|
uint8_t block[1024];
|
||||||
fread(&block, 1, 1024, f);
|
if (fread(&block, 1, 1024, f) == 0 ||
|
||||||
if (memcmp(&mem[0x9320], &block, 1024) != 0)
|
memcmp(&mem[0x9320], &block, 1024) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int idlen = ppfFileIdLen(f, 2);
|
int idlen = ppfFileIdLen(f, 2);
|
||||||
|
@ -402,8 +402,8 @@ static bool patchApplyPPF3(FILE* f, uint8_t** rom, int* size)
|
||||||
|
|
||||||
if (blockcheck) {
|
if (blockcheck) {
|
||||||
uint8_t block[1024];
|
uint8_t block[1024];
|
||||||
fread(&block, 1, 1024, f);
|
if (fread(&block, 1, 1024, f) == 0 ||
|
||||||
if (memcmp(&mem[(imagetype == 0) ? 0x9320 : 0x80A0], &block, 1024) != 0)
|
memcmp(&mem[(imagetype == 0) ? 0x9320 : 0x80A0], &block, 1024) != 0)
|
||||||
return false;
|
return false;
|
||||||
count -= 1024;
|
count -= 1024;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue