Fix of incorrect usage of wxString in fopen in AppUpdater and Downloader.

This commit is contained in:
David Kocik 2024-08-19 13:50:59 +02:00 committed by Lukas Matena
parent b7f0b51c3b
commit 447dd15681
2 changed files with 3 additions and 3 deletions

View File

@ -187,9 +187,9 @@ void FileGet::priv::get_perform()
FILE* file;
// open file for writting
if (m_written == 0)
file = fopen(temp_path_wstring.c_str(), "wb");
file = fopen(into_u8(temp_path_wstring).c_str(), "wb");
else
file = fopen(temp_path_wstring.c_str(), "ab");
file = fopen(into_u8(temp_path_wstring).c_str(), "ab");
//assert(file != NULL);
if (file == NULL) {

View File

@ -222,7 +222,7 @@ boost::filesystem::path AppUpdater::priv::download_file(const DownloadAppData& d
tmp_path += format(".%1%%2%", std::to_string(GUI::GLCanvas3D::timestamp_now()), ".download");
FILE* file;
wxString temp_path_wstring(tmp_path.wstring());
file = fopen(temp_path_wstring.c_str(), "wb");
file = fopen(GUI::into_u8(temp_path_wstring).c_str(), "wb");
assert(file != NULL);
if (file == NULL) {
std::string line1 = GUI::format(_u8L("Download from %1% couldn't start:"), data.url);