]> granicus.if.org Git - gc/commitdiff
Fix vsprintf_args initialization/cleanup in CORD_vsprintf for EMX
authorIvan Maidanski <ivmai@mail.ru>
Sun, 22 Jun 2014 16:49:01 +0000 (20:49 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 16 Mar 2016 20:48:50 +0000 (23:48 +0300)
* cord/cordprnt.c (CORD_vsprintf): Do not use va_copy and va_end if
EMX (as the primitives are missing).

cord/cordprnt.c

index ce59a757a65e234fb078e1668cfb52aff29f3974..cfa1e710c98b5ff136b4b10c53a5fb19bd0e3ba3 100644 (file)
@@ -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;