summaryrefslogtreecommitdiffstats
path: root/fb-helper.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-01-25 12:11:31 +0100
committerFlorian Pritz <bluewind@xinu.at>2012-01-25 12:11:31 +0100
commit3e32e2ce18fba5a52d2d1ddbaf34b6800f644f03 (patch)
treec2bc126241a0c09605724409eec32e06d36d7595 /fb-helper.c
parentbcb55411af16c89a633c2e7c8e04769766a9fec7 (diff)
fb-helper.c: catch read() errors
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb-helper.c')
-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);