Jelajahi Sumber

Fix initializing return buffer.

Use "bufSize", not the "buf" itself.
bank 11 tahun lalu
induk
melakukan
c23f3fbd9f
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Engine/source/console/fileSystemFunctions.cpp

+ 2 - 2
Engine/source/console/fileSystemFunctions.cpp

@@ -696,7 +696,7 @@ DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd )
 	"@ingroup FileSystem")
 {
    static const U32 bufSize = 512;
-   char *buf = Con::getReturnBuffer(buf);
+   char *buf = Con::getReturnBuffer(bufSize);
    Platform::makeFullPathName(path, buf, bufSize, dStrlen(cwd) > 1 ? cwd : NULL);
    return buf;
 }
@@ -723,7 +723,7 @@ DefineEngineFunction(pathConcat, String, ( const char* path, const char* file),,
 	"@ingroup FileSystem")
 {
    static const U32 bufSize = 1024;
-   char *buf = Con::getReturnBuffer(buf);
+   char *buf = Con::getReturnBuffer(bufSize);
    Platform::makeFullPathName(file, buf, bufSize, path);
    return buf;
 }