From 5cc607c0c320ae143dce2becedc1af4e14962020 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 16 Mar 2026 19:22:55 +0100 Subject: [PATCH] Use slightly fewer characters --- components/files/windowspath.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp index 74d7eea912..2df3f3017e 100644 --- a/components/files/windowspath.cpp +++ b/components/files/windowspath.cpp @@ -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); } }