From 99a3a904e4d9cc2e4d92edbbf1ebbd0892d3918e Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 3 Sep 2024 14:36:54 +1000 Subject: Handle collation text that includes '\0' This seems to be tickled by the ogg comment handling changes (possibly libtags doesn't actually handle this case?) --- src/locale/collation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/locale/collation.cpp') diff --git a/src/locale/collation.cpp b/src/locale/collation.cpp index 8748742d..c3360483 100644 --- a/src/locale/collation.cpp +++ b/src/locale/collation.cpp @@ -89,8 +89,8 @@ GLibCollator::~GLibCollator() { auto GLibCollator::Transform(const std::string& in) -> std::string { size_t size = glib_strxfrm(NULL, in.c_str(), 0, locale_data_.get()); char* dest = new char[size + 1]{0}; - glib_strxfrm(dest, in.c_str(), size, locale_data_.get()); - std::string out{dest, strnlen(dest, size)}; + size = glib_strxfrm(dest, in.c_str(), size, locale_data_.get()); + std::string out{dest, size}; delete[] dest; return out; } -- cgit v1.2.3