Parcourir la source

Merge pull request #973 from dgough/next

Fixed bug in FileSystem::getDirectoryName()
Sean Paul Taylor il y a 12 ans
Parent
commit
96f5206b4c
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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)