diff --git a/SConstruct b/SConstruct index ab10f71b5..e505aa7ac 100644 --- a/SConstruct +++ b/SConstruct @@ -1294,7 +1294,8 @@ static void terminate_handler() main = ''' PHYSFS_File *f; char b[1] = {0}; - PHYSFS_init(""); + if (!PHYSFS_init("")) + return 1; f = PHYSFS_openWrite("a"); PHYSFS_sint64 w = PHYSFS_write(f, b, 1, 1); (void)w; diff --git a/similar/misc/physfsx.cpp b/similar/misc/physfsx.cpp index 7f9ebc39a..ab1bd0ca9 100644 --- a/similar/misc/physfsx.cpp +++ b/similar/misc/physfsx.cpp @@ -104,7 +104,8 @@ bool PHYSFSX_init(int argc, char *argv[]) #define base_dir PHYSFS_getBaseDir() #endif - PHYSFS_init(argv[0]); + if (!PHYSFS_init(argv[0])) + Error("Failed to init PhysFS: %s", PHYSFS_getLastError()); PHYSFS_permitSymbolicLinks(1); #ifdef macintosh