diff --git a/dll/local_storage.cpp b/dll/local_storage.cpp index 45d2871a..2a236824 100644 --- a/dll/local_storage.cpp +++ b/dll/local_storage.cpp @@ -469,7 +469,7 @@ std::string Local_Storage::get_user_appdata_path() { std::string user_appdata_path("SAVE"); #if defined(STEAM_WIN32) - WCHAR szPath[MAX_PATH * 10] = {}; + WCHAR szPath[MAX_PATH] = {}; HRESULT hr = SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, szPath); @@ -521,6 +521,7 @@ static std::string sanitize_file_name(std::string name) name = replace_with(name, "*", ".ASTERISK."); name = replace_with(name, "\"", ".QUOTE."); name = replace_with(name, "?", ".Q_MARK."); + name = replace_with(name, "%", ".PERCENT."); return name; } @@ -538,6 +539,7 @@ static std::string desanitize_file_name(std::string name) name = replace_with(name, ".ASTERISK.", "*"); name = replace_with(name, ".QUOTE.", "\""); name = replace_with(name, ".Q_MARK.", "?"); + name = replace_with(name, ".PERCENT.", "%"); return name; } diff --git a/dll/steam_http.cpp b/dll/steam_http.cpp index 08a80194..f5a7778b 100644 --- a/dll/steam_http.cpp +++ b/dll/steam_http.cpp @@ -222,8 +222,9 @@ void Steam_HTTP::online_http_request(Steam_Http_Request *request, SteamAPICall_t directory_path = "."; file_name = request->target_filepath; } - PRINT_DEBUG("directory: '%s', filename '%s'", directory_path.c_str(), file_name.c_str()); + PRINT_DEBUG("directory: '%s', filename '%s', target_filepath '%s'", directory_path.c_str(), file_name.c_str(), request->target_filepath.c_str()); Local_Storage::store_file_data(directory_path, file_name, (char *)"", sizeof("")); + PRINT_DEBUG("Temp file created with empty data"); //TODO remove this FILE *hfile = std::fopen(request->target_filepath.c_str(), "wb"); if (!hfile) {