mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12:00
Qt: use fs::get_temp_dir during updates
GetTempPathW was falsely using size in bytes instead of string length.
This commit is contained in:
parent
faaf644331
commit
2d82e3ef9a
1 changed files with 1 additions and 6 deletions
|
@ -396,12 +396,7 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
|
||||||
const std::string exe_dir = rpcs3::utils::get_exe_dir();
|
const std::string exe_dir = rpcs3::utils::get_exe_dir();
|
||||||
const std::string orig_path = exe_dir + "rpcs3.exe";
|
const std::string orig_path = exe_dir + "rpcs3.exe";
|
||||||
const std::wstring wchar_orig_path = utf8_to_wchar(orig_path);
|
const std::wstring wchar_orig_path = utf8_to_wchar(orig_path);
|
||||||
|
const std::string tmpfile_path = fs::get_temp_dir() + "\\rpcs3_update.7z";
|
||||||
wchar_t wide_temp_path[MAX_PATH + 1]{};
|
|
||||||
GetTempPathW(sizeof(wide_temp_path), wide_temp_path);
|
|
||||||
|
|
||||||
std::string tmpfile_path = wchar_to_utf8(wide_temp_path);
|
|
||||||
tmpfile_path += "\\rpcs3_update.7z";
|
|
||||||
|
|
||||||
fs::file tmpfile(tmpfile_path, fs::read + fs::write + fs::create + fs::trunc);
|
fs::file tmpfile(tmpfile_path, fs::read + fs::write + fs::create + fs::trunc);
|
||||||
if (!tmpfile)
|
if (!tmpfile)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue