From: Matthias Braun Date: Thu, 17 Jun 2010 09:19:30 +0000 (+0000) Subject: fix obstack_printf function - we have to explicitely copy va_list ap, because vsnprin... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=d932e36cb60d0edbe287931fa1c03807de438a82;p=libfirm fix obstack_printf function - we have to explicitely copy va_list ap, because vsnprintf consumes it [r27630] --- 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