From 9f134725c7691c4dd9e7294f622bd124e24d9058 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 7 Nov 2023 23:33:46 +0100 Subject: [PATCH] Fix handling of non-ASCII characters when resizing file --- CMakeLists.txt | 2 +- io/passwordfile.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0efd48..0c10278 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ endif () set(CONFIGURATION_PACKAGE_SUFFIX "" CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities") -find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED) +find_package(c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.14.0 REQUIRED) use_cpp_utilities(VISIBILITY PUBLIC) # find 3rd party libraries diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index 8e28b54..3174e47 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -430,7 +431,7 @@ void PasswordFile::save(PasswordFileSaveFlags options) const auto newSize = static_cast(m_file.tellp()); if (fileSize && newSize < fileSize) { m_file.close(); - std::filesystem::resize_file(m_path, newSize); + std::filesystem::resize_file(makeNativePath(m_path), newSize); } }