summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-12-15 14:03:27 +0100
committerPhilipp Zabel <p.zabel@pengutronix.de>2014-12-15 14:08:22 +0100
commit268f6402dc67ca47b68e027e932b195d9f17f0d7 (patch)
treea6d3576630c7e8ea477c6e070a6c9041ffc70c77
parentf58c14e9ef201035609ce3cf5a412dc18ac93d52 (diff)
downloadkmsfbwrap-268f6402dc67ca47b68e027e932b195d9f17f0d7.tar.gz
kmsfbwrap-268f6402dc67ca47b68e027e932b195d9f17f0d7.tar.xz
png: fix compiler warnings in png_load
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r--src/png.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/png.c b/src/png.c
index 0a89c15..350f960 100644
--- a/src/png.c
+++ b/src/png.c
@@ -47,12 +47,12 @@ int png_load(char *name, struct splash *image, unsigned char **alpha)
char id[4];
fh = fopen(name,"rb");
- if (fh == -1)
+ if (fh == NULL)
return -ENOENT;
- fread(&id, 1, 4, fh);
+ ret = fread(&id, 1, 4, fh);
- if (!(id[1] == 'P' && id[2]=='N' && id[3]=='G'))
+ if (ret != 4 || !(id[1] == 'P' && id[2]=='N' && id[3]=='G'))
return -EINVAL;
rewind(fh);