[Scummvm-cvs-logs] SF.net SVN: scummvm:[44532] scummvm/trunk/engines/sci/engine/vm.cpp
wjpalenstijn at users.sourceforge.net
wjpalenstijn at users.sourceforge.net
Fri Oct 2 14:44:12 CEST 2009
Revision: 44532
http://scummvm.svn.sourceforge.net/scummvm/?rev=44532&view=rev
Author: wjpalenstijn
Date: 2009-10-02 12:44:12 +0000 (Fri, 02 Oct 2009)
Log Message:
-----------
SCI: Use String::printf instead of temporary buffer
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2009-10-02 11:04:36 UTC (rev 44531)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2009-10-02 12:44:12 UTC (rev 44532)
@@ -110,17 +110,13 @@
const char *names[4] = {"global", "local", "temp", "param"};
if (index < 0 || index >= max) {
- char txt[200];
- char tmp[40];
- sprintf(txt, "[VM] validate_variable(): Attempt to use invalid %s variable %04x ", names[type], index);
+ Common::String txt = Common::String::printf("[VM] validate_variable(): Attempt to use invalid %s variable %04x ", names[type], index);
if (max == 0)
- strcat(txt, "(variable type invalid)");
- else {
- sprintf(tmp, "(out of range [%d..%d])", 0, max - 1);
- strcat(txt, tmp);
- }
+ txt += "(variable type invalid)";
+ else
+ txt += Common::String::printf("(out of range [%d..%d])", 0, max - 1);
- warning("%s", txt);
+ warning("%s", txt.c_str());
if (type == VAR_PARAM || type == VAR_TEMP) {
int total_offset = r - stack_base;
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