r836 - trunk/platform

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Mar 14 02:39:17 EDT 2007


Author: icculus
Date: 2007-03-14 02:39:17 -0400 (Wed, 14 Mar 2007)
New Revision: 836

Modified:
   trunk/platform/macclassic.c
Log:
Mac Classic platform layer: don't strcmp() a NULL string.


Modified: trunk/platform/macclassic.c
===================================================================
--- trunk/platform/macclassic.c	2007-03-14 06:30:52 UTC (rev 835)
+++ trunk/platform/macclassic.c	2007-03-14 06:39:17 UTC (rev 836)
@@ -124,15 +124,16 @@
 {
     char buf[sizeof (ERR_MACOS_GENERIC) + 32];
     const char *errstr = get_macos_error_string(retval);
-    if (strcmp(errstr, ERR_MACOS_GENERIC) == 0)
+    if (errstr != NULL)
     {
-        sprintf(buf, ERR_MACOS_GENERIC, (int) retval);
-        errstr = buf;
-    } /* if */
+        if (strcmp(errstr, ERR_MACOS_GENERIC) == 0)
+        {
+            sprintf(buf, ERR_MACOS_GENERIC, (int) retval);
+            errstr = buf;
+        } /* if */
 
-    if (errstr != NULL)
         __PHYSFS_setError(errstr);
-
+    } /* if */
     return(retval);
 } /* oserr */
 




More information about the physfs-commits mailing list