summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fb-helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fb-helper.c b/fb-helper.c
index 71ae0ab..6abf81d 100644
--- a/fb-helper.c
+++ b/fb-helper.c
@@ -53,7 +53,13 @@ int load_file(const char *fn, char **data, size_t *data_size)
perror("load_file");
return 1;
}
+
*data_size += fread(*data + *data_size, sizeof(char), buf_size, fp);
+
+ if (ferror(fp)) {
+ perror("load_file");
+ return 1;
+ }
}
fclose(fp);