head 1.2; access; symbols OPENPKG_E1_MP_HEAD:1.2 OPENPKG_E1_MP:1.2 OPENPKG_E1_MP_2_STABLE:1.2 OPENPKG_E1_FP:1.2 OPENPKG_2_STABLE_20061018:1.2 OPENPKG_2_STABLE:1.2.0.10 OPENPKG_2_STABLE_BP:1.2 OPENPKG_2_5_SOLID:1.2.0.8 OPENPKG_2_5_SOLID_BP:1.2 OPENPKG_2_4_RELEASE:1.2 OPENPKG_2_4_SOLID:1.2.0.6 OPENPKG_2_4_SOLID_BP:1.2 OPENPKG_2_3_RELEASE:1.2 OPENPKG_2_3_SOLID:1.2.0.4 OPENPKG_2_3_SOLID_BP:1.2 OPENPKG_2_2_RELEASE:1.2 OPENPKG_2_2_SOLID:1.2.0.2 OPENPKG_2_2_SOLID_BP:1.2 OPENPKG_2_1_RELEASE:1.1 OPENPKG_2_1_SOLID:1.1.0.2 OPENPKG_2_1_SOLID_BP:1.1; locks; strict; comment @# @; 1.2 date 2004.08.23.09.01.26; author tho; state dead; branches; next 1.1; 1.1 date 2004.05.21.07.49.32; author rse; state Exp; branches; next ; desc @@ 1.2 log @upgrading package: gift 0.11.6 -> 0.11.7 @ text @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 @ 1.1 log @take over Debian bugfix (hopefully va_copy is portable enough) @ text @@