diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index 85bb055bdf..a91b6354e8 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -274,7 +274,7 @@ void DetermineBasePaths(const char *exe) } else { /* Use the folder of the config file as working directory. */ wchar_t config_dir[MAX_PATH]; - wcsncpy(path, convert_to_fs(_config_file, path, lengthof(path)), lengthof(path)); + convert_to_fs(_config_file, path, lengthof(path)); if (!GetFullPathName(path, static_cast(std::size(config_dir)), config_dir, nullptr)) { Debug(misc, 0, "GetFullPathName failed ({})", GetLastError()); _searchpaths[SP_WORKING_DIR].clear(); @@ -292,7 +292,7 @@ void DetermineBasePaths(const char *exe) _searchpaths[SP_BINARY_DIR].clear(); } else { wchar_t exec_dir[MAX_PATH]; - wcsncpy(path, convert_to_fs(exe, path, std::size(path)), std::size(path)); + convert_to_fs(exe, path, std::size(path)); if (!GetFullPathName(path, static_cast(std::size(exec_dir)), exec_dir, nullptr)) { Debug(misc, 0, "GetFullPathName failed ({})", GetLastError()); _searchpaths[SP_BINARY_DIR].clear();