changeset 7054:923bec010d54

fix build of Toolbox::NormalizeAet()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 11 Aug 2026 19:00:41 +0200
parents 29f895d70f3e
children 45817b3c1664 a0dd2f56eeb1
files OrthancFramework/Sources/Toolbox.cpp
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Toolbox.cpp	Tue Aug 11 18:57:20 2026 +0200
+++ b/OrthancFramework/Sources/Toolbox.cpp	Tue Aug 11 19:00:41 2026 +0200
@@ -3057,14 +3057,18 @@
   // + removes leading and trailing spaces that must be ignored
   std::string Toolbox::NormalizeAet(const std::string& aet)
   {
-    std::string normalizedAet = aet;
-    uint8_t* p = reinterpret_cast<uint8_t*>(normalizedAet.data());
-
-    for (size_t i = 0; i < aet.size(); ++i, ++p)
+    std::string normalizedAet;
+
+    for (size_t i = 0; i < aet.size(); ++i)
     {
-      if (iscntrl(*p) || *p == '\\')
+      if (iscntrl(aet[i]) ||
+          aet[i] == '\\')
       {
-        *p = '*';
+        normalizedAet.push_back('*');
+      }
+      else
+      {
+        normalizedAet.push_back(aet[i]);
       }
     }