Explorar o código

Fixed bug in FileSystem::getDirectoryName()

Darryl Gough %!s(int64=12) %!d(string=hai) anos
pai
achega
87fe193810
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      gameplay/src/FileSystem.cpp

+ 1 - 1
gameplay/src/FileSystem.cpp

@@ -590,7 +590,7 @@ std::string FileSystem::getDirectoryName(const char* path)
 #else
     // dirname() modifies the input string so create a temp string
     std::string dirname;
-    char* tempPath = new char[strlen(path)];
+    char* tempPath = new char[strlen(path) + 1];
     strcpy(tempPath, path);
     char* dir = ::dirname(tempPath);
     if (dir && strlen(dir) > 0)