Browse Source

Update fileSystem_ScriptBinding.cc

Using an U32 instead of an S32 allows us to have twice the buffer size.
Peter Robinson 3 năm trước cách đây
mục cha
commit
3cd4286a96
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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 "";
 
    // 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;
 
    // Get a return buffer.
@@ -347,7 +347,7 @@ ConsoleFunctionWithDocs(getFileList, ConsoleString, 2, 2, (strPath))
    char* p = 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);
        p += dStrlen(files[i].pFileName);