Codechange: use std::string GetString variant

This commit is contained in:
Rubidium
2023-05-31 17:16:31 +02:00
committed by rubidium42
parent 324c43eeb2
commit d9f8a4c380
5 changed files with 16 additions and 28 deletions

View File

@@ -2792,9 +2792,9 @@ const char *GetSaveLoadErrorString()
SetDParam(0, _sl.error_str);
SetDParamStr(1, _sl.extra_msg);
static char err_str[512];
GetString(err_str, _sl.action == SLA_SAVE ? STR_ERROR_GAME_SAVE_FAILED : STR_ERROR_GAME_LOAD_FAILED, lastof(err_str));
return err_str;
static std::string err_str;
err_str = GetString(_sl.action == SLA_SAVE ? STR_ERROR_GAME_SAVE_FAILED : STR_ERROR_GAME_LOAD_FAILED);
return err_str.c_str();
}
/** Show a gui message when saving has failed */