aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/console.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 2fede327f1..a53e97888b 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -660,7 +660,7 @@ void ConsoleDialog::updateScrollBuffer() {
}
int ConsoleDialog::printf(const char *format, ...) {
- va_list argptr;
+ va_list argptr;
va_start(argptr, format);
int count = this->vprintf(format, argptr);
@@ -669,10 +669,17 @@ int ConsoleDialog::printf(const char *format, ...) {
}
int ConsoleDialog::vprintf(const char *format, va_list argptr) {
- Common::String output = Common::String::vprintf(format, argptr);
+ char buf[2048];
- print(output.c_str());
- return output.size();
+#if defined(WIN32)
+ int count = _vsnprintf(buf, sizeof(buf), format, argptr);
+#elif defined(__SYMBIAN32__)
+ int count = vsprintf(buf, format, argptr);
+#else
+ int count = vsnprintf(buf, sizeof(buf), format, argptr);
+#endif
+ print(buf);
+ return count;
}
void ConsoleDialog::putchar(int c) {