[Scummvm-git-logs] scummvm master -> 6ec5d970f688eb417f5ea4bdf815db8cf457674b

digitall noreply at scummvm.org
Mon Feb 13 17:35:55 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6ec5d970f6 ULTIMA: ULTIMA4: Fix Format Truncation GCC Compiler Warnings


Commit: 6ec5d970f688eb417f5ea4bdf815db8cf457674b
    https://github.com/scummvm/scummvm/commit/6ec5d970f688eb417f5ea4bdf815db8cf457674b
Author: D G Turner (digitall at scummvm.org)
Date: 2023-02-13T17:35:17Z

Commit Message:
ULTIMA: ULTIMA4: Fix Format Truncation GCC Compiler Warnings

Changed paths:
    engines/ultima/ultima4/game/game.cpp


diff --git a/engines/ultima/ultima4/game/game.cpp b/engines/ultima/ultima4/game/game.cpp
index f4efccd5257..04c272854bd 100644
--- a/engines/ultima/ultima4/game/game.cpp
+++ b/engines/ultima/ultima4/game/game.cpp
@@ -712,14 +712,12 @@ const int colors[] = {
 void showMixturesSuper(int page = 0) {
 	g_screen->screenTextColor(FG_WHITE);
 	for (int i = 0; i < 13; i++) {
-		char buf[4];
 
 		const Spell *s = g_spells->getSpell(i + 13 * page);
 		int line = i + 8;
 		g_screen->screenTextAt(2, line, "%s", s->_name);
 
-		snprintf(buf, 4, "%3d", g_ultima->_saveGame->_mixtures[i + 13 * page]);
-		g_screen->screenTextAt(6, line, "%s", buf);
+		g_screen->screenTextAt(6, line, "%s", Common::String::format("%3d", g_ultima->_saveGame->_mixtures[i + 13 * page]).c_str());
 
 		g_screen->screenShowChar(32, 9, line);
 		int comp = s->_components;
@@ -729,8 +727,7 @@ void showMixturesSuper(int page = 0) {
 		}
 		g_screen->screenTextColor(FG_WHITE);
 
-		snprintf(buf, 3, "%2d", s->_mp);
-		g_screen->screenTextAt(19, line, "%s", buf);
+		g_screen->screenTextAt(19, line, "%s", Common::String::format("%2d", s->_mp).c_str());
 	}
 }
 




More information about the Scummvm-git-logs mailing list