From: Holger Schemel Date: Sat, 30 Nov 2024 08:46:08 +0000 (+0100) Subject: fixed crash bug caused by using va_list twice X-Git-Tag: 4.4.0.0-test-4~13 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1063cd224d9d02d60445735c83e008e311473550;p=rocksndiamonds.git fixed crash bug caused by using va_list twice --- diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 599879eb..e12daa8e 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1252,10 +1252,15 @@ char *getStringToLower(const char *s) static char *getStringVPrint(char *format, va_list ap) { + va_list ap_test; char test[1]; + va_copy(ap_test, ap); + // determine required size of string to be printed - int size = vsnprintf(test, 1, format, ap); + int size = vsnprintf(test, 1, format, ap_test); + + va_end(ap_test); // check if something went wrong (should not happen) if (size < 0)