[Scummvm-cvs-logs] scummvm master -> 14c8bdafe5ce73df57662221316345ed443a6323

lordhoto lordhoto at gmail.com
Wed Mar 9 22:42:49 CET 2016


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

Summary:
305e34a718 SHERLOCK: Add format to fix compile error
14c8bdafe5 Merge pull request #702 from ckorn/ftbfs2


Commit: 305e34a718a0e433e859d1a35e654747deb3fad7
    https://github.com/scummvm/scummvm/commit/305e34a718a0e433e859d1a35e654747deb3fad7
Author: Christoph Korn (christoph.korn at posteo.de)
Date: 2016-03-09T22:24:55+01:00

Commit Message:
SHERLOCK: Add format to fix compile error

This patch fixes the compile error:
format not a string literal and no
format arguments [-Werror=format-security]

Just suply "%s" as the standard format.
This way the string is not interpreted as format
which may lead to security issues.

Changed paths:
    engines/sherlock/tattoo/tattoo_darts.cpp



diff --git a/engines/sherlock/tattoo/tattoo_darts.cpp b/engines/sherlock/tattoo/tattoo_darts.cpp
index fe707a8..0a815af 100644
--- a/engines/sherlock/tattoo/tattoo_darts.cpp
+++ b/engines/sherlock/tattoo/tattoo_darts.cpp
@@ -178,7 +178,7 @@ void Darts::playDarts(GameType gameType) {
 					scoredPoints = Common::String::format(FIXED(DartsScoredPoints), lastDart);
 				}
 
-				screen.print(Common::Point(_dartInfo.left, _dartInfo.top + _spacing), 0, scoredPoints.c_str());
+				screen.print(Common::Point(_dartInfo.left, _dartInfo.top + _spacing), 0, "%s", scoredPoints.c_str());
 			} else {
 				Common::String hitText;
 
@@ -213,7 +213,7 @@ void Darts::playDarts(GameType gameType) {
 						break;
 					}
 				}
-				screen.print(Common::Point(_dartInfo.left, _dartInfo.top + _spacing), 0, hitText.c_str());
+				screen.print(Common::Point(_dartInfo.left, _dartInfo.top + _spacing), 0, "%s", hitText.c_str());
 			}
 
 			if (score != 0 && playerNum == 0 && !gameOver)
@@ -417,12 +417,12 @@ void Darts::showStatus(int playerNum) {
 
 	// "Round: x"
 	Common::String dartsRoundStatus = Common::String::format(FIXED(DartsCurrentRound), _roundNum);
-	screen.print(Common::Point(STATUS_INFO_X, temp), 0, dartsRoundStatus.c_str());
+	screen.print(Common::Point(STATUS_INFO_X, temp), 0, "%s", dartsRoundStatus.c_str());
 
 	if (_gameType == GAME_301) {
 		// "Turn Total: x"
 		Common::String dartsTotalPoints = Common::String::format(FIXED(DartsCurrentTotalPoints), _roundScore);
-		screen.print(Common::Point(STATUS_INFO_X, STATUS_INFO_Y + 75), 0, dartsTotalPoints.c_str());
+		screen.print(Common::Point(STATUS_INFO_X, STATUS_INFO_Y + 75), 0, "%s", dartsTotalPoints.c_str());
 	} else {
 		// Show cricket scores
 		for (int x = 0; x < 7; ++x) {
@@ -935,7 +935,7 @@ int Darts::throwDart(int dartNum, int computer) {
 
 	// "Dart # x"
 	Common::String currentDart = Common::String::format(FIXED(DartsCurrentDart), dartNum);
-	screen.print(Common::Point(_dartInfo.left, _dartInfo.top), 0, currentDart.c_str());
+	screen.print(Common::Point(_dartInfo.left, _dartInfo.top), 0, "%s", currentDart.c_str());
 
 	drawDartsLeft(dartNum, computer);
 


Commit: 14c8bdafe5ce73df57662221316345ed443a6323
    https://github.com/scummvm/scummvm/commit/14c8bdafe5ce73df57662221316345ed443a6323
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2016-03-09T22:42:45+01:00

Commit Message:
Merge pull request #702 from ckorn/ftbfs2

SHERLOCK: Add format to fix compile error

Changed paths:
    engines/sherlock/tattoo/tattoo_darts.cpp









More information about the Scummvm-git-logs mailing list