diff options
author | Nikias Bassen | 2014-08-06 03:07:35 +0200 |
---|---|---|
committer | Nikias Bassen | 2014-08-06 03:07:35 +0200 |
commit | 99d83b9017fb46eaeb9d7682fe263fced31c39a3 (patch) | |
tree | 15d6e21b4dea64dcb29e3317cdf4a21e57295223 | |
parent | d56ad899e66b07b9a5f3cd802b2881ced1961011 (diff) | |
download | libimobiledevice-99d83b9017fb46eaeb9d7682fe263fced31c39a3.tar.gz libimobiledevice-99d83b9017fb46eaeb9d7682fe263fced31c39a3.tar.bz2 |
common/utils: Silence compiler warning about ignored return value from fread()
-rw-r--r-- | common/utils.c | 5 |
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; |