From dcd00dec81a2841ad5244e043379697c68d681f7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 26 Feb 2024 13:22:15 +0100 Subject: [PATCH] Fix incorrect clipping in String::substr_index(). --- core/string/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 53f921785..9af939d0c 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -934,7 +934,7 @@ String String::substr_index(const int start_index, const int end_index) const { return ""; } - if (end_index >= s) { + if (end_index > s) { return substr(start_index, (s - 1) - start_index); }