Use sizeof(fullPath), as suggested by @vLKp.

This commit is contained in:
C.W. Betts 2018-08-23 21:28:04 -06:00
parent e2a33dc81f
commit 9cfa12c0fe

View file

@ -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<uint8_t *>(fullPath), PATH_MAX + 5)) {
fullPath[PATH_MAX + 4] = '\0';
if (CFURLGetFileSystemRepresentation(resourcesURL, TRUE, reinterpret_cast<uint8_t *>(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);
}