summaryrefslogtreecommitdiff
path: root/src/locale/collation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/locale/collation.cpp')
-rw-r--r--src/locale/collation.cpp4
1 files changed, 2 insertions, 2 deletions
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;
}