Browse Source

Update fileSystem_ScriptBinding.cc

Using an U32 instead of an S32 allows us to have twice the buffer size.
Peter Robinson 3 years ago
parent
commit
3cd4286a96
1 changed files with 3 additions and 3 deletions
  1. 3 3
      engine/source/io/fileSystem_ScriptBinding.cc

+ 3 - 3
engine/source/io/fileSystem_ScriptBinding.cc

@@ -337,9 +337,9 @@ ConsoleFunctionWithDocs(getFileList, ConsoleString, 2, 2, (strPath))
        return "";
        return "";
 
 
    // Grab the required buffer length.
    // Grab the required buffer length.
-   S32 length = 0;
+   U32 length = 0;
 
 
-   for (S32 i = 0; i < files.size(); i++)
+   for (U32 i = 0; i < files.size(); i++)
        length += dStrlen(files[i].pFileName) + 1;
        length += dStrlen(files[i].pFileName) + 1;
 
 
    // Get a return buffer.
    // Get a return buffer.
@@ -347,7 +347,7 @@ ConsoleFunctionWithDocs(getFileList, ConsoleString, 2, 2, (strPath))
    char* p = buffer;
    char* p = buffer;
 
 
    // Copy the directory names to the buffer.
    // Copy the directory names to the buffer.
-   for (S32 i = 0; i < files.size(); i++)
+   for (U32 i = 0; i < files.size(); i++)
    {
    {
        dStrcpy(p, files[i].pFileName);
        dStrcpy(p, files[i].pFileName);
        p += dStrlen(files[i].pFileName);
        p += dStrlen(files[i].pFileName);