summaryrefslogtreecommitdiffhomepage
path: root/ir/obstack
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2010-06-17 11:19:30 +0200
committerMatthias Braun <matze@braunis.de>2010-06-17 11:19:30 +0200
commitd932e36cb60d0edbe287931fa1c03807de438a82 (patch)
tree27c5c96df570e25729ee8434b02b1e56605f1e19 /ir/obstack
parent9022c59ec32373291b4685c60ee4751b30c41594 (diff)
fix obstack_printf function - we have to explicitely copy va_list ap, because vsnprintf consumes it
[r27630]
Diffstat (limited to 'ir/obstack')
-rw-r--r--ir/obstack/obstack_printf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ir/obstack/obstack_printf.c b/ir/obstack/obstack_printf.c
index 9d92092..eb5b86e 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