From 06ad21caab4ba4ffa5fac6d6394d5a7fa6429665 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 18 Dec 2025 13:28:36 +0100 Subject: [PATCH] string: fix strncoll to trim string lengths MSVC implementation does not stop on zero terminator. Signed-off-by: Simon Rozman --- include/stdex/string.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/stdex/string.hpp b/include/stdex/string.hpp index eaa7d0b55..f70af44c9 100644 --- a/include/stdex/string.hpp +++ b/include/stdex/string.hpp @@ -1511,7 +1511,7 @@ namespace stdex stdex_assert(str1 || !count1); stdex_assert(str2 || !count2); auto& collate = std::use_facet>(locale); - return collate.compare(str1, str1 + count1, str2, str2 + count2); + return collate.compare(str1, str1 + strnlen(str1, count1), str2, str2 + strnlen(str2, count2)); } ///