Skip to content

Commit c1f86f3

Browse files
authored
Fixed appdata path containing the null terminator character (#366)
1 parent 68b9060 commit c1f86f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/Overload/OvTools/src/OvTools/Utils/SystemCalls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ std::string OvTools::Utils::SystemCalls::GetPathToAppdata()
4545
// Convert app-data path from wide char to UTF-8 string
4646
const int size_needed = WideCharToMultiByte(CP_UTF8, 0, path.get(), -1, nullptr, 0, nullptr, nullptr);
4747
assert(size_needed > 0 && "failed to convert from wide char to UTF-8");
48-
std::string appDataPath(size_needed, 0);
48+
std::string appDataPath(size_needed - 1, 0);
4949
WideCharToMultiByte(CP_UTF8, 0, path.get(), -1, &appDataPath[0], size_needed, nullptr, nullptr);
5050
return appDataPath;
5151
}

0 commit comments

Comments
 (0)