From 1bb03e1549a9050049bc027566a448a530298b64 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Sat, 22 Nov 2008 23:54:34 +0000 Subject: * Hunted down improper uses of va_list variables. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13383 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/strlib.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common/strlib.c') diff --git a/src/common/strlib.c b/src/common/strlib.c index 93b69ab54..5580124e1 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -964,9 +964,12 @@ int StringBuf_Vprintf(StringBuf* self, const char* fmt, va_list ap) for(;;) { + va_list apcopy; /* Try to print in the allocated space. */ size = self->max_ - (self->ptr_ - self->buf_); + va_copy(apcopy, ap); n = vsnprintf(self->ptr_, size, fmt, ap); + va_end(ap); /* If that worked, return the length. */ if( n > -1 && n < size ) { -- cgit v1.2.3-60-g2f50