Nikolay Sivov : wpp: Properly use va_start/va_end around vsnprintf().
Module: wine Branch: master Commit: fdcf7cc9afa99ba120298dafaa5b5907ee781fa4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fdcf7cc9afa99ba120298dafaa... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Feb 18 14:06:36 2012 +0300 wpp: Properly use va_start/va_end around vsnprintf(). --- libs/wpp/ppl.l | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 98f3e1a..2718fd0 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -329,6 +329,7 @@ void pp_writestring(const char *format, ...) va_start(valist, format); len = vsnprintf(buffer, buffercapacity, format, valist); + va_end(valist); /* If the string is longer than buffersize, vsnprintf returns * the string length with glibc >= 2.1, -1 with glibc < 2.1 */ while(len > buffercapacity || len < 0) @@ -345,10 +346,11 @@ void pp_writestring(const char *format, ...) return; } buffer = new_buffer; + va_start(valist, format); len = vsnprintf(buffer, buffercapacity, format, valist); + va_end(valist); } - va_end(valist); wpp_callbacks->write(buffer, len); }
participants (1)
-
Alexandre Julliard