diff --git a/similar/misc/physfsx.cpp b/similar/misc/physfsx.cpp index 0b112f210..af1d1fcc6 100644 --- a/similar/misc/physfsx.cpp +++ b/similar/misc/physfsx.cpp @@ -230,8 +230,8 @@ bool PHYSFSX_init(int argc, char *argv[]) if (mainBundle) { CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); if (resourcesURL) { - if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, reinterpret_cast(fullPath), PATH_MAX + 5)) { - fullPath[PATH_MAX + 4] = '\0'; + if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, reinterpret_cast(fullPath), sizeof(fullPath))) { + fullPath[sizeof(fullPath) - 1] = '\0'; con_printf(CON_DEBUG, "PHYSFS: append resources directory \"%s\" to search path", fullPath); PHYSFS_addToSearchPath(fullPath, 1); }