From d932e36cb60d0edbe287931fa1c03807de438a82 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 17 Jun 2010 09:19:30 +0000 Subject: [PATCH] fix obstack_printf function - we have to explicitely copy va_list ap, because vsnprintf consumes it [r27630] --- ir/obstack/obstack_printf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ir/obstack/obstack_printf.c b/ir/obstack/obstack_printf.c index 9d92092eb..eb5b86e45 100644 --- a/ir/obstack/obstack_printf.c +++ b/ir/obstack/obstack_printf.c @@ -16,7 +16,9 @@ int obstack_vprintf(struct obstack *obst, const char *fmt, va_list ap) int len; for (;;) { - len = vsnprintf(buffer, size, fmt, ap); + va_list tap; + va_copy(tap, ap); + len = vsnprintf(buffer, size, fmt, tap); /* snprintf should return -1 only in the error case, but older glibcs * and probably other systems are buggy in this respect and return -1 if -- 2.20.1