Use slightly fewer characters

This commit is contained in:
Evil Eye
2026-03-16 19:22:55 +01:00
parent 833424cd4c
commit 5cc607c0c3
+2 -2
View File
@@ -62,11 +62,11 @@ namespace Files
// This should always be true. Note that we don't need to care above because of the trailing \0
if (len % sizeof(wchar_t) == 0)
{
std::wstring_view view(buffer.data(), buffer.data() + len / sizeof(wchar_t));
std::wstring_view view(buffer.data(), len / sizeof(wchar_t));
// Strip trailing \0 because the path constructor won't do it for us
const auto pos = view.find(L'\0');
if (pos != std::wstring_view::npos)
view.remove_suffix(view.size() - pos);
view = view.substr(0, pos);
return std::filesystem::path(view);
}
}