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:
parent
b8cc3217d2
commit
49cd57fbd9
@ -168,10 +168,15 @@ void Log::printMessage(int level, const char *component, const char *format,
|
||||
if(!m_file_stdout ||
|
||||
UserConfigParams::m_log_errors_to_console) // log to console & file
|
||||
{
|
||||
VALIST out;
|
||||
va_copy(out, va_list);
|
||||
|
||||
setTerminalColor((LogLevel)level);
|
||||
printf("[%s] %s: ", names[level], component);
|
||||
vprintf(format, va_list);
|
||||
vprintf(format, out);
|
||||
resetTerminalColor(); // this prints a \n
|
||||
|
||||
va_end(out);
|
||||
}
|
||||
if(m_file_stdout)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user