aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/winansi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/win32/winansi.c b/win32/winansi.c
index d61e8a2cf..c0493c77e 100644
--- a/win32/winansi.c
+++ b/win32/winansi.c
@@ -536,9 +536,14 @@ int winansi_vfprintf(FILE *stream, const char *format, va_list list)
536 if (!buf) 536 if (!buf)
537 goto abort; 537 goto abort;
538 538
539 len = vsnprintf(buf, len + 1, format, list); 539 va_copy(cp, list);
540 len = vsnprintf(buf, len + 1, format, cp);
541 va_end(cp);
540 } 542 }
541 543
544 if (len == -1)
545 goto abort;
546
542 rv = ansi_emulate(buf, stream); 547 rv = ansi_emulate(buf, stream);
543 548
544 if (buf != small_buf) 549 if (buf != small_buf)