diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 6c5f70c03..0391327f4 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -156,9 +156,10 @@ void InsertCDDlg() snprintf( text, 1024, + "%s", _("Unable to open main data archive (diabdat.mpq or spawn.mpq).\n" - "\n" - "Make sure that it is in the game folder and that the file name is in all lowercase.")); + "\n" + "Make sure that it is in the game folder and that the file name is in all lowercase.")); UiErrorOkDialog(_("Data File Error"), text); app_fatal(nullptr); diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 7cca1e985..f0e5ec67f 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -157,7 +157,7 @@ extern void plrctrls_after_game_logic(); [[noreturn]] static void print_help_and_exit() { - printInConsole(_("Options:\n")); + printInConsole("%s", _("Options:\n")); printInConsole(" %-20s %-30s\n", "-h, --help", _("Print this message and exit")); printInConsole(" %-20s %-30s\n", "--version", _("Print the version and exit")); printInConsole(" %-20s %-30s\n", "--data-dir", _("Specify the folder of diabdat.mpq")); @@ -170,7 +170,7 @@ extern void plrctrls_after_game_logic(); printInConsole(" %-20s %-30s\n", "-x", _("Run in windowed mode")); printInConsole(" %-20s %-30s\n", "--verbose", _("Enable verbose logging")); printInConsole(" %-20s %-30s\n", "--spawn", _("Force spawn mode even if diabdat.mpq is found")); - printInConsole(_("\nHellfire options:\n")); + printInConsole("%s", _("\nHellfire options:\n")); printInConsole(" %-20s %-30s\n", "--diablo", _("Force diablo mode even if hellfire.mpq is found")); printInConsole(" %-20s %-30s\n", "--nestart", _("Use alternate nest palette")); #ifdef _DEBUG @@ -188,7 +188,7 @@ extern void plrctrls_after_game_logic(); printInConsole(" %-20s %-30s\n", "-r <##########>", "Set map seed"); printInConsole(" %-20s %-30s\n", "-t <##>", "Set current quest level"); #endif - printInConsole(_("\nReport bugs at https://github.com/diasurgical/devilutionX/\n")); + printInConsole("%s", _("\nReport bugs at https://github.com/diasurgical/devilutionX/\n")); diablo_quit(0); } diff --git a/Source/dvlnet/tcp_client.cpp b/Source/dvlnet/tcp_client.cpp index d5b0fd6f0..b031a23ed 100644 --- a/Source/dvlnet/tcp_client.cpp +++ b/Source/dvlnet/tcp_client.cpp @@ -65,7 +65,7 @@ int tcp_client::join(std::string addrstr, std::string passwd) } } if (plr_self == PLR_BROADCAST) { - SDL_SetError(_("Unable to connect")); + SDL_SetError("%s", _("Unable to connect")); return -1; } diff --git a/Source/init.cpp b/Source/init.cpp index 98254f849..f4ea29cd9 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -209,7 +209,7 @@ void init_archives() void init_create_window() { if (!SpawnWindow(PROJECT_NAME)) - app_fatal(_("Unable to create main window")); + app_fatal("%s", _("Unable to create main window")); dx_init(); gbActive = true; #ifndef USE_SDL1 diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index dc87f189e..4f84cdc25 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -994,10 +994,10 @@ void LoadGame(bool firstflag) LoadHelper file("game"); if (!file.isValid()) - app_fatal(_("Unable to open save file archive")); + app_fatal("%s", _("Unable to open save file archive")); if (!IsHeaderValid(file.nextLE())) - app_fatal(_("Invalid save file")); + app_fatal("%s", _("Invalid save file")); if (gbIsHellfireSaveGame) { giNumberOfLevels = 25; @@ -1026,7 +1026,7 @@ void LoadGame(bool firstflag) int _nobjects = file.nextBE(); if (!gbIsHellfire && currlevel > 17) - app_fatal(_("Player is on a Hellfire only level")); + app_fatal("%s", _("Player is on a Hellfire only level")); for (uint8_t i = 0; i < giNumberOfLevels; i++) { glSeedTbl[i] = file.nextBE(); @@ -1783,7 +1783,7 @@ void SaveGameData() else if (!gbIsSpawn && !gbIsHellfire) file.writeLE(LoadLE32("RETL")); else - app_fatal(_("Invalid game state")); + app_fatal("%s", _("Invalid game state")); if (gbIsHellfire) { giNumberOfLevels = 25; @@ -2021,7 +2021,7 @@ void LoadLevel() GetPermLevelNames(szName); LoadHelper file(szName); if (!file.isValid()) - app_fatal(_("Unable to open save file archive")); + app_fatal("%s", _("Unable to open save file archive")); if (leveltype != DTYPE_TOWN) { for (int j = 0; j < MAXDUNY; j++) { diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index 33b8a2cbd..4fab5ba98 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -120,7 +120,7 @@ void mainmenu_loop() do { menu = MAINMENU_NONE; if (!UiMainMenuDialog(gszProductName, &menu, effects_play_sound, 30)) - app_fatal(_("Unable to display mainmenu")); + app_fatal("%s", _("Unable to display mainmenu")); switch (menu) { case MAINMENU_NONE: diff --git a/Source/msg.cpp b/Source/msg.cpp index a7abeca0d..9ae0118e4 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -176,13 +176,13 @@ bool msg_wait_resync() } if (gbGameDestroyed) { - DrawDlg(_("The game ended")); + DrawDlg("%s", _("The game ended")); msg_free_packets(); return false; } if (sgbDeltaChunks != MAX_CHUNKS) { - DrawDlg(_("Unable to get level data")); + DrawDlg("%s", _("Unable to get level data")); msg_free_packets(); return false; } @@ -607,7 +607,7 @@ static void delta_put_item(TCmdPItem *pI, int x, int y, BYTE bLevel) && pD->dwSeed == pI->dwSeed) { if (pD->bCmd == CMD_ACK_PLRINFO) return; - app_fatal(_("Trying to drop a floor item?")); + app_fatal("%s", _("Trying to drop a floor item?")); } } diff --git a/Source/pfile.cpp b/Source/pfile.cpp index 47fbbe024..848dacedc 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -214,7 +214,7 @@ PFileScopedArchiveWriter::PFileScopedArchiveWriter(bool clear_tables) , clear_tables_(clear_tables) { if (!pfile_open_archive(save_num_)) - app_fatal(_("Failed to open player archive for writing.")); + app_fatal("%s", _("Failed to open player archive for writing.")); } PFileScopedArchiveWriter::~PFileScopedArchiveWriter() @@ -388,9 +388,9 @@ void pfile_read_player_from_save(char name[16], int playerId) save_num = pfile_get_save_num_from_name(name); archive = pfile_open_save_archive(save_num); if (archive == nullptr) - app_fatal(_("Unable to open archive")); + app_fatal("%s", _("Unable to open archive")); if (!pfile_read_hero(archive, &pkplr)) - app_fatal(_("Unable to load character")); + app_fatal("%s", _("Unable to load character")); gbValidSaveFile = pfile_archive_contains_game(archive); if (gbValidSaveFile) @@ -413,7 +413,7 @@ bool LevelFileExists() DWORD save_num = pfile_get_save_num_from_name(plr[myplr]._pName); if (!pfile_open_archive(save_num)) - app_fatal(_("Unable to read to save file archive")); + app_fatal("%s", _("Unable to read to save file archive")); bool has_file = mpqapi_has_file(szName); mpqapi_flush_and_close(true); @@ -436,7 +436,7 @@ void GetPermLevelNames(char *szPerm) save_num = pfile_get_save_num_from_name(plr[myplr]._pName); GetTempLevelNames(szPerm); if (!pfile_open_archive(save_num)) - app_fatal(_("Unable to read to save file archive")); + app_fatal("%s", _("Unable to read to save file archive")); has_file = mpqapi_has_file(szPerm); mpqapi_flush_and_close(true); @@ -455,7 +455,7 @@ void pfile_remove_temp_files() DWORD save_num = pfile_get_save_num_from_name(plr[myplr]._pName); if (!pfile_open_archive(save_num)) - app_fatal(_("Unable to write to save file archive")); + app_fatal("%s", _("Unable to write to save file archive")); mpqapi_remove_hash_entries(GetTempSaveNames); mpqapi_flush_and_close(true); } @@ -467,7 +467,7 @@ void pfile_write_save_file(const char *pszName, BYTE *pbData, DWORD dwLen, DWORD save_num = pfile_get_save_num_from_name(plr[myplr]._pName); codec_encode(pbData, dwLen, qwLen, pfile_get_password()); if (!pfile_open_archive(save_num)) - app_fatal(_("Unable to write to save file archive")); + app_fatal("%s", _("Unable to write to save file archive")); mpqapi_write_file(pszName, pbData, qwLen); mpqapi_flush_and_close(true); } diff --git a/Source/qol/monhealthbar.cpp b/Source/qol/monhealthbar.cpp index ebcfe0729..bb2d29cce 100644 --- a/Source/qol/monhealthbar.cpp +++ b/Source/qol/monhealthbar.cpp @@ -32,7 +32,7 @@ void InitMonsterHealthBar() if ((healthBox.surface == nullptr) || (health.surface == nullptr) || (resistance.surface == nullptr)) { - app_fatal(_("Failed to load UI resources. Is devilutionx.mpq accessible and up to date?")); + app_fatal("%s", _("Failed to load UI resources. Is devilutionx.mpq accessible and up to date?")); } } diff --git a/Source/qol/xpbar.cpp b/Source/qol/xpbar.cpp index 15f072ddb..dd658b3bb 100644 --- a/Source/qol/xpbar.cpp +++ b/Source/qol/xpbar.cpp @@ -49,7 +49,7 @@ void InitXPBar() LoadMaskedArt("data\\xpbar.pcx", &xpbarArt, 1, 1); if (xpbarArt.surface == nullptr) { - app_fatal(_("Failed to load UI resources. Is devilutionx.mpq accessible and up to date?")); + app_fatal("%s", _("Failed to load UI resources. Is devilutionx.mpq accessible and up to date?")); } } }