[Scummvm-cvs-logs] SF.net SVN: scummvm:[43445] scummvm/trunk/engines/scumm/imuse/imuse.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Aug 16 19:36:16 CEST 2009


Revision: 43445
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43445&view=rev
Author:   lordhoto
Date:     2009-08-16 17:36:16 +0000 (Sun, 16 Aug 2009)

Log Message:
-----------
Fix warning caused by -Wformat-security, also fixed a possible buffer overflow along with it.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse/imuse.cpp

Modified: scummvm/trunk/engines/scumm/imuse/imuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse/imuse.cpp	2009-08-16 17:35:59 UTC (rev 43444)
+++ scummvm/trunk/engines/scumm/imuse/imuse.cpp	2009-08-16 17:36:16 UTC (rev 43445)
@@ -695,11 +695,11 @@
 		return -1;
 
 	{
-		char string[128];
-		sprintf(string, "doCommand - %d (%d/%d)", a[0], (int)param, (int)cmd);
+		Common::String string = "doCommand - ";
+		string += Common::String::printf("%d (%d/%d)", a[0], (int)param, (int)cmd);
 		for (i = 1; i < numargs; ++i)
-			sprintf(string + strlen(string), ", %d", a[i]);
-		debugC(DEBUG_IMUSE, string);
+			string += Common::String::printf(", %d", a[i]);
+		debugC(DEBUG_IMUSE, "%s", string.c_str());
 	}
 
 	if (param == 0) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list