diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-26 23:23:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-26 23:23:13 +0300 |
commit | d5592fe254c7061ca8bbcea93b6098dc9bf3d683 (patch) | |
tree | 740a09af66dbfe68763d2d9b721479e67bafe434 /source/blender/imbuf/intern | |
parent | 5689ab39754dcd7229f616e3eed206bea5611545 (diff) |
fixes for errors/warnings found with cppcheck
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index f248e6bb6c4..61254944001 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -279,7 +279,7 @@ struct ImBuf *IMB_loadiffname(const char *naam, int flags) { file = open(naam, O_BINARY|O_RDONLY); - if (file == -1) return (0); + if (file < 0) return (0); ibuf= IMB_loadifffile(file, flags); @@ -304,7 +304,7 @@ struct ImBuf *IMB_testiffname(char *naam,int flags) { flags |= IB_test; file = open(naam,O_BINARY|O_RDONLY); - if (file<=0) return (0); + if (file < 0) return (0); ibuf=IMB_loadifffile(file,flags); if (ibuf) { diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index c89bc6a632f..acc3e06448f 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -296,7 +296,10 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags) if (ibuf->cmap){ for (i = 0 ; i<ibuf->maxcol ; i++){ - if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) return (0); + if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) { + fclose(fildes); + return (0); + } } } |