]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagtiff.cpp
no, we shouldn't inconditionally add the separator at the end even if wxPATH_GET_SEPA...
[wxWidgets.git] / src / common / imagtiff.cpp
index 0c741c92c1725465379fbfc19bdeb9d7da841607..48ca43ab9856c737e2980d08925d94970610ff79 100644 (file)
@@ -370,11 +370,13 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream )
 {
     unsigned char hdr[2];
 
-    stream.Read(&hdr, 2);
-    stream.SeekI(-2, wxFromCurrent);
+    if ( !stream.Read(&hdr, WXSIZEOF(hdr)) )
+        return FALSE;
+
+    stream.SeekI(-WXSIZEOF(hdr), wxFromCurrent);
 
-    return ((hdr[0] == 0x49 && hdr[1] == 0x49) ||
-            (hdr[0] == 0x4D && hdr[1] == 0x4D));
+    return (hdr[0] == 'I' && hdr[1] == 'I') ||
+           (hdr[0] == 'M' && hdr[1] == 'M');
 }