Inline functions may complicate passing va_lists around, as they can be stack offsets.

See http://julipedia.meroh.net/2011/09/using-vacopy-to-safely-pass-ap.html


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12811 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
curaga 2013-05-30 12:52:14 +00:00
parent b8cc3217d2
commit 49cd57fbd9

View File

@ -168,10 +168,15 @@ void Log::printMessage(int level, const char *component, const char *format,
if(!m_file_stdout || if(!m_file_stdout ||
UserConfigParams::m_log_errors_to_console) // log to console & file UserConfigParams::m_log_errors_to_console) // log to console & file
{ {
VALIST out;
va_copy(out, va_list);
setTerminalColor((LogLevel)level); setTerminalColor((LogLevel)level);
printf("[%s] %s: ", names[level], component); printf("[%s] %s: ", names[level], component);
vprintf(format, va_list); vprintf(format, out);
resetTerminalColor(); // this prints a \n resetTerminalColor(); // this prints a \n
va_end(out);
} }
if(m_file_stdout) if(m_file_stdout)
{ {