Fix save corruption on switch (#1585)

This commit is contained in:
GaryOderNichts 2022-09-25 18:19:53 +02:00 committed by GitHub
parent e412a8b55e
commit da893a5b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -523,9 +523,9 @@ void SaveManager::SaveFile(int fileNum) {
}
#ifdef __SWITCH__
const char* json_string = baseBlock.dump(4).c_str();
FILE* w = fopen(GetFileName(fileNum).c_str(), "w");
fwrite(json_string, sizeof(char), strlen(json_string), w);
std::string json_string = baseBlock.dump(4);
fwrite(json_string.c_str(), sizeof(char), json_string.length(), w);
fclose(w);
#else