Revision: 2567
          http://tmux.svn.sourceforge.net/tmux/?rev=2567&view=rev
Author:   nicm
Date:     2011-07-25 09:56:43 +0000 (Mon, 25 Jul 2011)

Log Message:
-----------
Can't use the same va_list twice, from Emanuele Giaquinta.

Modified Paths:
--------------
    trunk/compat/asprintf.c

Modified: trunk/compat/asprintf.c
===================================================================
--- trunk/compat/asprintf.c     2011-07-22 15:10:24 UTC (rev 2566)
+++ trunk/compat/asprintf.c     2011-07-25 09:56:43 UTC (rev 2567)
@@ -44,12 +44,15 @@
 vasprintf(char **ret, const char *fmt, va_list ap)
 {
        int      n;
+       va_list  ap2;
 
+       va_copy(ap2, ap);
+
        if ((n = vsnprintf(NULL, 0, fmt, ap)) < 0)
                goto error;
 
        *ret = xmalloc(n + 1);
-       if ((n = vsnprintf(*ret, n + 1, fmt, ap)) < 0) {
+       if ((n = vsnprintf(*ret, n + 1, fmt, ap2)) < 0) {
                xfree(*ret);
                goto error;
        }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to