From 4572a0c7742bf5333c3235e96fed8b7206f4db59 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 11 Mar 2023 12:48:57 -0600 Subject: [PATCH] fix getDirectoryList used dStrcat (note: not dStrncat, so there the buffer destination size *is* the third var) --- Engine/source/console/fileSystemFunctions.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Engine/source/console/fileSystemFunctions.cpp b/Engine/source/console/fileSystemFunctions.cpp index b6fb119ba..3de93e4c6 100644 --- a/Engine/source/console/fileSystemFunctions.cpp +++ b/Engine/source/console/fileSystemFunctions.cpp @@ -489,9 +489,7 @@ DefineEngineFunction(getDirectoryList, String, ( const char* path, S32 depth ), // Append a trailing backslash if it's not present already. if (fullpath[dStrlen(fullpath) - 1] != '/') { - S32 pos = dStrlen(fullpath); - fullpath[pos - 1] = '/'; - fullpath[pos] = '\0'; + dStrcat(fullpath, "/\0", 1024); } // Dump the directories.