diff options
author | Littleboy | 2011-09-19 09:21:36 -0400 |
---|---|---|
committer | Littleboy | 2011-09-19 09:23:00 -0400 |
commit | 9796890cce47e43d06b5459459150d44b39b1883 (patch) | |
tree | 4a009825cee545ce92a7e7f37c9e8bb45a044850 | |
parent | ce4c98d75715192823655f8e255b894c5bb92364 (diff) | |
download | scummvm-rg350-9796890cce47e43d06b5459459150d44b39b1883.tar.gz scummvm-rg350-9796890cce47e43d06b5459459150d44b39b1883.tar.bz2 scummvm-rg350-9796890cce47e43d06b5459459150d44b39b1883.zip |
GUI: Replace ConsoleDialog use of vsnprintf by Common::String::vformat()
-rw-r--r-- | gui/console.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gui/console.cpp b/gui/console.cpp index b656d23a09..bfce04cbf6 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -665,12 +665,11 @@ int ConsoleDialog::printFormat(int dummy, const char *format, ...) { } int ConsoleDialog::vprintFormat(int dummy, const char *format, va_list argptr) { - char buf[2048]; + Common::String buffer = Common::String::vformat(format, argptr); - int count = vsnprintf(buf, sizeof(buf), format, argptr); - buf[sizeof(buf)-1] = 0; // ensure termination - print(buf); - return count; + print(buffer.c_str()); + + return buffer.size(); } void ConsoleDialog::printChar(int c) { |