diff --git a/src/display/window_file_list.cc b/src/display/window_file_list.cc index c15207c7..9a25beff 100644 --- a/src/display/window_file_list.cc +++ b/src/display/window_file_list.cc @@ -25,7 +25,10 @@ WindowFileList::WindowFileList(const ui::ElementFileList* element) : // Convert std::string to std::wstring of given width (in screen positions), // taking into account that some characters may be occupying two screen positions. std::wstring -wstring_width(const std::string& i_str, [[maybe_unused]] int width) { +wstring_width(const std::string& i_str, int width) { + if (width < 0) + width = 0; + std::wstring result(width + 1, L' '); size_t length = std::mbstowcs(result.data(), i_str.c_str(), width);