string: fix strncoll to trim string lengths
Some checks failed
Doxygen Action / build (push) Has been cancelled

MSVC implementation does not stop on zero terminator.

Signed-off-by: Simon Rozman <simon.rozman@amebis.si>
This commit is contained in:
2025-12-18 13:28:36 +01:00
parent 83fa108f99
commit 06ad21caab

View File

@@ -1511,7 +1511,7 @@ namespace stdex
stdex_assert(str1 || !count1);
stdex_assert(str2 || !count2);
auto& collate = std::use_facet<std::collate<T>>(locale);
return collate.compare(str1, str1 + count1, str2, str2 + count2);
return collate.compare(str1, str1 + strnlen(str1, count1), str2, str2 + strnlen(str2, count2));
}
///