diff options
author | Neal Walfield <neal@walfield.org> | 2002-09-05 18:24:16 +0200 |
---|---|---|
committer | Neal Walfield <neal@walfield.org> | 2002-09-05 18:24:16 +0200 |
commit | cab999130dbb8224224735f83a774249cfd38e26 (patch) | |
tree | df37a9f75e3e83c0f9a5bde7fd2f9901c5690e02 | |
parent | 2002-09-03 Neal H. Walfield <neal@g10code.de> (diff) | |
download | gnupg2-cab999130dbb8224224735f83a774249cfd38e26.tar.xz gnupg2-cab999130dbb8224224735f83a774249cfd38e26.zip |
2002-09-04 Neal H. Walfield <neal@g10code.de>
* vasprintf.c (vasprintf) [va_copy]: Use va_copy.
[!va_copy && __va_copy]: Use __va_copy.
[!va_copy && !__va_copy]: Only now fall back to using memcpy.
-rw-r--r-- | common/ChangeLog | 6 | ||||
-rw-r--r-- | common/vasprintf.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index 3fa688654..ff886650d 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,9 @@ +2002-09-04 Neal H. Walfield <neal@g10code.de> + + * vasprintf.c (vasprintf) [va_copy]: Use va_copy. + [!va_copy && __va_copy]: Use __va_copy. + [!va_copy && !__va_copy]: Only now fall back to using memcpy. + 2002-08-21 Werner Koch <wk@gnupg.org> * errors.h: Added STATUS_IMPORT_PROBLEM. diff --git a/common/vasprintf.c b/common/vasprintf.c index 36121d8cc..2af2d3a20 100644 --- a/common/vasprintf.c +++ b/common/vasprintf.c @@ -39,8 +39,15 @@ vasprintf (char **result, const char *format, va_list *args) int total_width = strlen (format) + 1; va_list ap; - /* FIXME: use va_copy() */ +#ifdef va_copy + va_copy (ap, args); +#else +#ifdef __va_copy + __va_copy (ap, args); +#else memcpy (&ap, args, sizeof (va_list)); +#endif /* __va_copy */ +#endif /* va_copy */ while (*p != '\0') { |