aboutsummaryrefslogtreecommitdiffstats
path: root/gc/cord
diff options
context:
space:
mode:
Diffstat (limited to 'gc/cord')
-rw-r--r--gc/cord/cordprnt.c16
1 files changed, 11 insertions, 5 deletions
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;