]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/gifdecod.cpp
Fixed bug in FlexGridSizer mods that prevented them from ever shrinking.
[wxWidgets.git] / src / common / gifdecod.cpp
index 011d8cf3ad06e2d385bbc767bb450ed19f04eaaf..784d7bdfab11dfbd6eeff229564443e21a5f6af5 100644 (file)
@@ -617,10 +617,12 @@ bool wxGIFDecoder::CanRead()
 {
     unsigned char buf[3];
 
 {
     unsigned char buf[3];
 
-    m_f->Read(buf, 3);
-    m_f->SeekI(-3, wxFromCurrent);
+    if ( !m_f->Read(buf, WXSIZEOF(buf)) )
+        return FALSE;
+
+    m_f->SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent);
 
 
-    return (memcmp(buf, "GIF", 3) == 0);
+    return memcmp(buf, "GIF", WXSIZEOF(buf)) == 0;
 }
 
 
 }