From 86d988132c8e422d34fd5732e18277253865791b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 13 Nov 2006 20:56:11 +0000 Subject: [PATCH] Prepend the Engine::errorString to debug messages, too (it should probably be renamed to reflect this...) svn-id: r24712 --- common/util.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/common/util.cpp b/common/util.cpp index aee003363b8..e238abe05f9 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -361,7 +361,16 @@ int gDebugLevel = -1; -static void debugHelper(char *buf, bool caret = true) { +static void debugHelper(const char *in_buf, bool caret = true) { + char buf[STRINGBUFLEN]; + + // Next, give the active engine (if any) a chance to augment the message + if (g_engine) { + g_engine->errorString(in_buf, buf); + } else { + strcpy(buf, in_buf); + } + #ifndef _WIN32_WCE if (caret) printf("%s\n", buf); @@ -448,8 +457,7 @@ void NORETURN CDECL error(const char *s, ...) { va_end(va); - // Next, give the active engine (if any) a chance to augment the - // error message + // Next, give the active engine (if any) a chance to augment the message if (g_engine) { g_engine->errorString(buf_input, buf_output); } else {