changeset 6234:51a0e464e898

fix build on older compilers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Jul 2025 12:43:12 +0200 (5 weeks ago)
parents a93598f96cc1
children 33bf50bffbdf
files OrthancFramework/Sources/HttpServer/HttpServer.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/HttpServer/HttpServer.cpp	Wed Jul 09 12:28:12 2025 +0200
+++ b/OrthancFramework/Sources/HttpServer/HttpServer.cpp	Wed Jul 09 12:43:12 2025 +0200
@@ -1255,7 +1255,8 @@
         std::string redirectionToRoot;
 
         std::string tmp(requestUri);
-        if (tmp.back() == '/')
+        if (!tmp.empty() &&
+            tmp[tmp.size() - 1] == '/')
         {
           redirectionToRoot = "../";
         }