aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2011-06-02 04:52:34 +0100
committerD G Turner2011-06-02 04:52:34 +0100
commit263ef4549996e40cdac1ec22b4cbda8ca94b482f (patch)
tree2401cb68829904c903782eb6deadfc15a019b18f
parentd3b53d4c5002171bf2050f495354bff7e1435ed1 (diff)
downloadscummvm-rg350-263ef4549996e40cdac1ec22b4cbda8ca94b482f.tar.gz
scummvm-rg350-263ef4549996e40cdac1ec22b4cbda8ca94b482f.tar.bz2
scummvm-rg350-263ef4549996e40cdac1ec22b4cbda8ca94b482f.zip
M4: Replace snprintf() usage with Common::String::format()
Safer and less portability issues.
-rw-r--r--engines/m4/globals.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index 8787f89d04..bf2c3abe1c 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -154,24 +154,24 @@ void Kernel::loadGlobalScriptFunctions() {
}
void Kernel::loadSectionScriptFunctions() {
- char tempFnName[128];
- snprintf(tempFnName, 128, "section_init_%d", currentSection);
+ Common::String tempFnName;
+ tempFnName = Common::String::format("section_init_%d", currentSection);
_sectionInitFn = _vm->_script->loadFunction(tempFnName);
- snprintf(tempFnName, 128, "section_daemon_%d", currentSection);
+ tempFnName = Common::String::format("section_daemon_%d", currentSection);
_sectionDaemonFn = _vm->_script->loadFunction(tempFnName);
- snprintf(tempFnName, 128, "section_parser_%d", currentSection);
+ tempFnName = Common::String::format("section_parser_%d", currentSection);
_sectionParserFn = _vm->_script->loadFunction(tempFnName);
}
void Kernel::loadRoomScriptFunctions() {
- char tempFnName[128];
- snprintf(tempFnName, 128, "room_init_%d", currentRoom);
+ Common::String tempFnName;
+ tempFnName = Common::String::format("room_init_%d", currentRoom);
_roomInitFn = _vm->_script->loadFunction(tempFnName);
- snprintf(tempFnName, 128, "room_daemon_%d", currentRoom);
+ tempFnName = Common::String::format("room_daemon_%d", currentRoom);
_roomDaemonFn = _vm->_script->loadFunction(tempFnName);
- snprintf(tempFnName, 128, "room_pre_parser_%d", currentRoom);
+ tempFnName = Common::String::format("room_pre_parser_%d", currentRoom);
_roomPreParserFn = _vm->_script->loadFunction(tempFnName);
- snprintf(tempFnName, 128, "room_parser_%d", currentRoom);
+ tempFnName = Common::String::format("room_parser_%d", currentRoom);
_roomParserFn = _vm->_script->loadFunction(tempFnName);
}