projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1063cd2
)
added using empty buffer to determine required size for vsnprintf
author
Holger Schemel
<holger.schemel@virtion.de>
Sat, 30 Nov 2024 08:50:26 +0000
(09:50 +0100)
committer
Holger Schemel
<holger.schemel@virtion.de>
Sat, 30 Nov 2024 08:50:57 +0000
(09:50 +0100)
src/libgame/misc.c
patch
|
blob
|
history
diff --git
a/src/libgame/misc.c
b/src/libgame/misc.c
index e12daa8e5faced231ea16c3b3ab0d28f791a14ab..40e766113b18a12fb5a40574df0b041397cfdd6c 100644
(file)
--- a/
src/libgame/misc.c
+++ b/
src/libgame/misc.c
@@
-1253,12
+1253,11
@@
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_test);
+ int size = vsnprintf(
NULL, 0
, format, ap_test);
va_end(ap_test);