projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a370e9
)
fixed crash bug caused by using va_list twice
author
Holger Schemel
<holger.schemel@virtion.de>
Sat, 30 Nov 2024 08:46:08 +0000
(09:46 +0100)
committer
Holger Schemel
<holger.schemel@virtion.de>
Sat, 30 Nov 2024 08:46:08 +0000
(09:46 +0100)
src/libgame/misc.c
patch
|
blob
|
history
diff --git
a/src/libgame/misc.c
b/src/libgame/misc.c
index 599879eb02f62ce5994da6bd57c7de613c499264..e12daa8e5faced231ea16c3b3ab0d28f791a14ab 100644
(file)
--- 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)