From bbfb18182564c310683c8e82c0679baa972d322b Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Tue, 18 Jun 2024 16:23:30 +0300
Subject: [PATCH] jira-archive-internal#67837 Fix LLDir::getScrubbedFileName

---
 indra/llfilesystem/lldir.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index 3ff6a592708..35891d73e8d 100644
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -902,10 +902,10 @@ std::string LLDir::getScrubbedFileName(const std::string uncleanFileName)
     std::string name(uncleanFileName);
     const std::string illegalChars(getForbiddenFileChars());
     // replace any illegal file chars with and underscore '_'
-    for( unsigned int i = 0; i < illegalChars.length(); i++ )
+    for( const char &ch : illegalChars)
     {
-        int j = -1;
-        while((j = name.find(illegalChars[i])) > -1)
+        std::string::size_type j = -1;
+        while((j = name.find(ch)) != std::string::npos)
         {
             name[j] = '_';
         }
-- 
GitLab