From bb118b7356439a930be13962ced5f36aab9f74bf Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Wed, 10 Jul 2002 14:21:11 +0000 Subject: import gc6.1alpha5 --- gc/cord/cordprnt.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'gc/cord') diff --git a/gc/cord/cordprnt.c b/gc/cord/cordprnt.c index 8d57f04..6ecc00e 100644 --- a/gc/cord/cordprnt.c +++ b/gc/cord/cordprnt.c @@ -233,7 +233,7 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args) if (width == NONE && prec == NONE) { register char c; - c = va_arg(args, int); + c = (char)va_arg(args, int); CORD_ec_append(result, c); goto done; } @@ -255,12 +255,18 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args) /* Use standard sprintf to perform conversion */ { register char * buf; - va_list vsprintf_args = args; - /* The above does not appear to be sanctioned */ - /* by the ANSI C standard. */ + va_list vsprintf_args; int max_size = 0; int res; - +# ifdef __va_copy + __va_copy(vsprintf_args, args); +# else +# if defined(__GNUC__) /* and probably in other cases */ + va_copy(vsprintf_args, args); +# else + vsprintf_args = args; +# endif +# endif if (width == VARIABLE) width = va_arg(args, int); if (prec == VARIABLE) prec = va_arg(args, int); if (width != NONE) max_size = width; -- cgit v1.2.3