From: Miroslav Lichvar Date: Wed, 16 Sep 2009 14:25:53 +0000 (+0200) Subject: don't use va_list in newtvwindow more than once (#523696) X-Git-Tag: r0-52-11~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8df34a7d2c32364c4afa730065cd202afd53c6f;p=thirdparty%2Fnewt.git don't use va_list in newtvwindow more than once (#523696) --- diff --git a/windows.c b/windows.c index df4e852..45035fd 100644 --- 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);