Changed code to avoid compiler warning.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402676
This commit is contained in:
Davis King 2008-11-28 02:51:46 +00:00
parent 99913d4b7d
commit 1f896c1fee

View File

@ -100,7 +100,11 @@ namespace dlib
throw image_load_error(std::string("png_loader: unable to open file ") + filename);
}
png_byte sig[8];
fread( sig, 1, 8, fp );
if (fread( sig, 1, 8, fp ) != 8)
{
fclose( fp );
throw image_load_error(std::string("png_loader: error reading file ") + filename);
}
if ( png_sig_cmp( sig, 0, 8 ) != 0 )
{
fclose( fp );