summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-08-06 03:07:35 +0200
committerGravatar Nikias Bassen2014-08-06 03:07:35 +0200
commit99d83b9017fb46eaeb9d7682fe263fced31c39a3 (patch)
tree15d6e21b4dea64dcb29e3317cdf4a21e57295223 /common
parentd56ad899e66b07b9a5f3cd802b2881ced1961011 (diff)
downloadlibimobiledevice-99d83b9017fb46eaeb9d7682fe263fced31c39a3.tar.gz
libimobiledevice-99d83b9017fb46eaeb9d7682fe263fced31c39a3.tar.bz2
common/utils: Silence compiler warning about ignored return value from fread()
Diffstat (limited to 'common')
-rw-r--r--common/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/utils.c b/common/utils.c
index 80f7060..0f65f4a 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -161,7 +161,10 @@ void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *le
}
*buffer = (char*)malloc(sizeof(char)*(size+1));
- fread(*buffer, sizeof(char), size, f);
+ if (fread(*buffer, sizeof(char), size, f) != size) {
+ fclose(f);
+ return;
+ }
fclose(f);
*length = size;