]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
don't use va_list in newtvwindow more than once (#523696)
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 16 Sep 2009 14:25:53 +0000 (16:25 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 16 Sep 2009 14:28:03 +0000 (16:28 +0200)
windows.c

index df4e852358ffe6ae159d3ac6e4485a381037ee5a..45035fd6c889d1296693253c934b8dab9a171875 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -19,10 +19,14 @@ static void * newtvwindow(char * title, char * button1, char * button2,
     newtGrid grid, buttonGrid;
 
     do {
+       va_list argscopy;
+
+       va_copy(argscopy, args);
        size += 1000;
        if (buf) free(buf);
        buf = malloc(size);
-       i = vsnprintf(buf, size, message, args);
+       i = vsnprintf(buf, size, message, argscopy);
+       va_end(argscopy);
     } while (i >= size || i == -1);
 
     flowedText = newtReflowText(buf, 35, 5, 5, &width, &height);