diff --git a/library/ColorText.cpp b/library/ColorText.cpp index 359b717e6..7f417e0a8 100644 --- a/library/ColorText.cpp +++ b/library/ColorText.cpp @@ -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); }