]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpcx.cpp
new wxASSERT implementation using wxAssert() helper function
[wxWidgets.git] / src / common / imagpcx.cpp
index 2e50e2c5a502ced4c829492350b2613d9e5709be..64a4d246b0efa5058f7aec2cfe7ed9524243ad88 100644 (file)
@@ -486,13 +486,12 @@ bool wxPCXHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
 
 bool wxPCXHandler::DoCanRead( wxInputStream& stream )
 {
-    unsigned char c;
-
-    c = stream.GetC();
-    stream.SeekI(-1, wxFromCurrent);
+    unsigned char c = stream.GetC();
+    if ( !stream )
+        return FALSE;
 
     // not very safe, but this is all we can get from PCX header :-(
-    return (c == 10);
+    return c == 10;
 }
 
 #endif // wxUSE_STREAMS && wxUSE_PCX