diff options
| author | Max Horn | 2011-03-18 14:42:51 +0100 | 
|---|---|---|
| committer | Max Horn | 2011-06-18 01:36:16 +0200 | 
| commit | b81207a04ecb5057b2b6efa0f3a6288b6e969aef (patch) | |
| tree | ef5aaaa273b1812a0e98bf4fcfb1bfa9803c8b05 /common/debug.cpp | |
| parent | d74e2d3224f7f43daf7bc90018b1b3f40a8c4596 (diff) | |
| download | scummvm-rg350-b81207a04ecb5057b2b6efa0f3a6288b6e969aef.tar.gz scummvm-rg350-b81207a04ecb5057b2b6efa0f3a6288b6e969aef.tar.bz2 scummvm-rg350-b81207a04ecb5057b2b6efa0f3a6288b6e969aef.zip | |
COMMON: Replace some vsnprintf/STRINGBUFLEN uses by vformat
Diffstat (limited to 'common/debug.cpp')
| -rw-r--r-- | common/debug.cpp | 13 | 
1 files changed, 4 insertions, 9 deletions
| diff --git a/common/debug.cpp b/common/debug.cpp index dbbb204deb..0dae344bb2 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -107,18 +107,13 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel) {  #ifndef DISABLE_TEXT_CONSOLE  static void debugHelper(const char *s, va_list va, bool caret = true) { -	char buf[STRINGBUFLEN]; +	Common::String buf = Common::String::vformat(s, va); -	vsnprintf(buf, STRINGBUFLEN, s, va); -	buf[STRINGBUFLEN-1] = '\0'; - -	if (caret) { -		buf[STRINGBUFLEN-2] = '\0'; -		strcat(buf, "\n"); -	} +	if (caret) +		buf += '\n';  	if (g_system) -		g_system->logMessage(LogMessageType::kDebug, buf); +		g_system->logMessage(LogMessageType::kDebug, buf.c_str());  	// TODO: Think of a good fallback in case we do not have  	// any OSystem yet.  } | 
