summaryrefslogtreecommitdiff
path: root/tools/pokemon_animation_graphics.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pokemon_animation_graphics.c')
-rw-r--r--tools/pokemon_animation_graphics.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/pokemon_animation_graphics.c b/tools/pokemon_animation_graphics.c
index 3ee1bd4cb..d57fa5b9c 100644
--- a/tools/pokemon_animation_graphics.c
+++ b/tools/pokemon_animation_graphics.c
@@ -100,7 +100,10 @@ void create_tilemap(struct Tilemap* tilemap, struct Graphic* graphic, char* grap
fprintf(stderr, "malloc failure\n");
exit(1);
}
- fread(graphics, 1, graphics_size, f);
+ if (graphics_size != (long)fread(graphics, 1, graphics_size, f)) {
+ fprintf(stderr, "failed to read file %s\n", graphics_filename);
+ exit(1);
+ }
fclose(f);
int num_tiles_per_frame = width * height;
@@ -213,7 +216,10 @@ int main(int argc, char* argv[]) {
if (!f) {
exit(1);
}
- fread(bytes, 1, 1, f);
+ if (1 != fread(bytes, 1, 1, f)) {
+ fprintf(stderr, "failed to read file %s\n", dimensions_filename);
+ exit(1);
+ }
fclose(f);
width = bytes[0] & 0xf;
height = bytes[0] >> 4;