瀏覽代碼

Fixed crash if PHYSFS_init(NULL) is used...

Ryan C. Gordon 23 年之前
父節點
當前提交
8dbc9bf877
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      platform/win32.c

+ 2 - 2
platform/win32.c

@@ -300,8 +300,8 @@ char **__PHYSFS_platformDetectAvailableCDs(void)
 
 
 char *__PHYSFS_platformCalcBaseDir(const char *argv0)
 char *__PHYSFS_platformCalcBaseDir(const char *argv0)
 {
 {
-    if (strchr(argv0, '\\') != NULL)   /* default behaviour can handle this. */
-        return(NULL);
+    if ((argv0 != NULL) && (strchr(argv0, '\\') != NULL))
+        return(NULL); /* default behaviour can handle this. */
 
 
     return(getExePath(argv0));
     return(getExePath(argv0));
 } /* __PHYSFS_platformCalcBaseDir */
 } /* __PHYSFS_platformCalcBaseDir */