Fix crash in vprinterr due to va_list misuse

develop
lethosor 2016-07-03 23:33:07 -04:00
parent 2455e36510
commit b4063352cf
1 changed files with 10 additions and 2 deletions

@ -126,10 +126,18 @@ void color_ostream::vprinterr(const char *format, va_list args)
color_value save = cur_color;
if (log_errors_to_stderr)
vfprintf(stderr, format, args);
{
va_list args1;
va_copy(args1, args);
vfprintf(stderr, format, args1);
va_end(args1);
}
color(COLOR_LIGHTRED);
vprint(format, args);
va_list args2;
va_copy(args2, args);
vprint(format, args2);
va_end(args2);
color(save);
}