diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2012-03-30 23:10:27 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-04-03 14:50:15 -0400 |
commit | 3685c3abf6c6f7d03b571458df52731ccf928981 (patch) | |
tree | b9f62ef56a43248d267bc061b429fea62a233137 /shared | |
parent | 1103a1a484999dc0d53eb6a42bc62f461a0a582d (diff) |
Fix `unused-result' warnings.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Diffstat (limited to 'shared')
-rw-r--r-- | shared/image-loader.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shared/image-loader.c b/shared/image-loader.c index 98cc431..029b92e 100644 --- a/shared/image-loader.c +++ b/shared/image-loader.c @@ -157,7 +157,7 @@ read_func(png_structp png, png_bytep data, png_size_t size) { FILE *fp = png_get_io_ptr(png); - if (fread(data, 1, size, fp) < 0) + if (fread(data, 1, size, fp) != size) png_error(png, NULL); } @@ -356,7 +356,9 @@ load_image(const char *filename) if (fp == NULL) return NULL; - fread(header, sizeof header, 1, fp); + if (fread(header, sizeof header, 1, fp) != 1) + return NULL; + rewind(fp); for (i = 0; i < ARRAY_LENGTH(loaders); i++) { if (memcmp(header, loaders[i].header, |