Use fixed buffer size var when allocating return buffer from console.

Conflicts:
	Engine/source/T3D/missionArea.cpp
	Engine/source/gui/editor/guiDebugger.cpp
This commit is contained in:
bank 2014-05-15 11:12:43 +04:00
parent d0a64026b0
commit f3fc84738b
42 changed files with 300 additions and 204 deletions

View file

@ -695,8 +695,9 @@ DefineEngineFunction(makeFullPath, String, ( const char* path, const char* cwd )
"@return String containing non-relative directory of path\n"
"@ingroup FileSystem")
{
char *buf = Con::getReturnBuffer(512);
Platform::makeFullPathName(path, buf, 512, dStrlen(cwd) > 1 ? cwd : NULL);
static const U32 bufSize = 512;
char *buf = Con::getReturnBuffer(buf);
Platform::makeFullPathName(path, buf, bufSize, dStrlen(cwd) > 1 ? cwd : NULL);
return buf;
}
@ -721,8 +722,9 @@ DefineEngineFunction(pathConcat, String, ( const char* path, const char* file),,
"@return String containing concatenated file name and path\n"
"@ingroup FileSystem")
{
char *buf = Con::getReturnBuffer(1024);
Platform::makeFullPathName(file, buf, 1024, path);
static const U32 bufSize = 1024;
char *buf = Con::getReturnBuffer(buf);
Platform::makeFullPathName(file, buf, bufSize, path);
return buf;
}