From 080b590261a41ae487446675bfbf545fd4801728 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 2 Jun 2011 10:49:09 +0200 Subject: MADE: Remove all instances of s(n)printf --- engines/made/script.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'engines/made/script.cpp') diff --git a/engines/made/script.cpp b/engines/made/script.cpp index 85e1a6ec6b..2776008828 100644 --- a/engines/made/script.cpp +++ b/engines/made/script.cpp @@ -639,10 +639,9 @@ void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *ext const char *sig = _commands[opcode - 1].sig; int valueType; /* 0: dec; 1: hex; 2: extended function */ int16 value; - char tempStr[32]; opcodeStats[opcode - 1]++; - snprintf(tempStr, 32, "[%04X] ", (uint16)(code - codeStart - 1)); - codeLine += tempStr; + + codeLine += Common::String::format("[%04X] ", (uint16)(code - codeStart - 1)); codeLine += desc; for (; *sig != '\0'; sig++) { codeLine += " "; @@ -670,19 +669,21 @@ void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *ext value = *code++; break; } + + Common::String tempStr; switch (valueType) { case 0: - snprintf(tempStr, 32, "%d", value); + tempStr = Common::String::format("%d", value); break; case 1: - snprintf(tempStr, 32, "0x%X", value); + tempStr = Common::String::format("0x%X", value); break; case 2: if (value < _functions->getCount()) { - snprintf(tempStr, 32, "%s", _functions->getFuncName(value)); + tempStr = Common::String::format("%s", _functions->getFuncName(value)); externStats[value]++; } else { - snprintf(tempStr, 32, "invalid: %d", value); + tempStr = Common::String::format("invalid: %d", value); } break; } -- cgit v1.2.3