diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-12-15 14:03:27 +0100 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2014-12-15 14:08:22 +0100 |
commit | 268f6402dc67ca47b68e027e932b195d9f17f0d7 (patch) | |
tree | a6d3576630c7e8ea477c6e070a6c9041ffc70c77 | |
parent | f58c14e9ef201035609ce3cf5a412dc18ac93d52 (diff) | |
download | kmsfbwrap-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |