Index: lib/strobj.c --- lib/strobj.c.orig 2003-12-23 05:22:53.000000000 +0100 +++ lib/strobj.c 2004-05-21 09:44:36.000000000 +0200 @@ -165,6 +165,7 @@ int string_appendvf (String *sobj, const char *fmt, va_list args) { + va_list args_cpy; int written = 0; if (!sobj) @@ -186,7 +187,15 @@ { max = sobj->alloc - sobj->len; - written = vsnprintf (sobj->str + sobj->len, max, fmt, args); + /* + * We have to make a copy of the va_list because we may pass this + * point multiple times. Note that simply calling va_start again is + * not a good idea since the va_start/va_end should be in the same + * stack frame because of some obscure implementations. + */ + va_copy (args_cpy, args); + written = vsnprintf (sobj->str + sobj->len, max, fmt, args_cpy); + va_end (args_cpy); /* * Some implementations use -1 to indicate an inability to write