diff options
author | Willem Jan Palenstijn | 2009-10-02 12:44:12 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-10-02 12:44:12 +0000 |
commit | 0fe40b505395ee7f54344be67741d6efb44e02f4 (patch) | |
tree | 5f360f902043fb0e1c8f90c6a3d4252b4535fa8a /engines/sci | |
parent | 292640b14e42b91fca0cf4ea07920ad38095a77d (diff) | |
download | scummvm-rg350-0fe40b505395ee7f54344be67741d6efb44e02f4.tar.gz scummvm-rg350-0fe40b505395ee7f54344be67741d6efb44e02f4.tar.bz2 scummvm-rg350-0fe40b505395ee7f54344be67741d6efb44e02f4.zip |
SCI: Use String::printf instead of temporary buffer
svn-id: r44532
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/vm.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 36512f96ed..ffd69a184f 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -110,17 +110,13 @@ static int validate_variable(reg_t *r, reg_t *stack_base, int type, int max, int 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; |