From 295554687f223311e29baa72cbc94f6e0949e9b9 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 22 Jun 2014 20:49:01 +0400 Subject: [PATCH] Fix vsprintf_args initialization/cleanup in CORD_vsprintf for EMX * cord/cordprnt.c (CORD_vsprintf): Do not use va_copy and va_end if EMX (as the primitives are missing). --- cord/cordprnt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cord/cordprnt.c b/cord/cordprnt.c index ce59a757..cfa1e710 100644 --- a/cord/cordprnt.c +++ b/cord/cordprnt.c @@ -269,7 +269,8 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args) # ifdef __va_copy __va_copy(vsprintf_args, args); # else -# if defined(__GNUC__) && !defined(__DJGPP__) /* and probably in other cases */ +# if defined(__GNUC__) && !defined(__DJGPP__) \ + && !defined(__EMX__) /* and probably in other cases */ va_copy(vsprintf_args, args); # else vsprintf_args = args; @@ -317,14 +318,16 @@ int CORD_vsprintf(CORD * out, CORD format, va_list args) break; default: # if defined(__va_copy) \ - || (defined(__GNUC__) && !defined(__DJGPP__)) + || (defined(__GNUC__) && !defined(__DJGPP__) \ + && !defined(__EMX__)) va_end(vsprintf_args); # endif return(-1); } res = vsprintf(buf, conv_spec, vsprintf_args); # if defined(__va_copy) \ - || (defined(__GNUC__) && !defined(__DJGPP__)) + || (defined(__GNUC__) && !defined(__DJGPP__) \ + && !defined(__EMX__)) va_end(vsprintf_args); # endif len = (size_t)res; -- 2.40.0