changeset 5685:4263b7afe789 octave-forge

Remove compiler warning
author hauberg
date Tue, 26 May 2009 13:00:38 +0000
parents e692af2b7645
children 4be8e71dd8b5
files main/image/src/pngread.cc
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/main/image/src/pngread.cc	Mon May 25 13:46:36 2009 +0000
+++ b/main/image/src/pngread.cc	Tue May 26 13:00:38 2009 +0000
@@ -182,10 +182,10 @@
   }
   
   unsigned char sig[8];
-  fread(sig,1,8,infile);
-  if (!png_check_sig(sig,8)) {
-    error("pngread invalid signature in %s", filename); 
-    fclose(infile);
+  const size_t bytes_read = fread (sig, 1, 8, infile);
+  if (!png_check_sig (sig, 8) || bytes_read != 8) {
+    error ("pngread invalid signature in %s", filename); 
+    fclose (infile);
     return NULL;
   }