fix unused fread return value warnings

This commit is contained in:
yenatch
2017-12-28 01:25:25 -05:00
parent bad9e33530
commit 40305f205e
6 changed files with 47 additions and 16 deletions

View File

@@ -21,7 +21,10 @@ uint8_t *read_u8(char *filename, int *size) {
*size = ftell(f);
rewind(f);
uint8_t *data = malloc(*size);
fread(data, 1, *size, f);
if (*size != (int)fread(data, 1, *size, f)) {
fprintf(stderr, "Could not read file: \"%s\"\n", filename);
exit(1);
}
fclose(f);
return data;
}