чување 07daabdf9467ae8110f0b6cd2ec3aebc675c65bb
родитељ b171040df07e258fe5bf096bdac6a2bccbce9829
Аутор: Страхиња Радић <sr@strahinja.org>
Датум: Sat, 19 Oct 2024 20:52:45 +0200
util.h: Fix tricky SEGV by putting macro parameters in parentheses
Diffstat:
измењених датотека: 1, додавања: 2(+), брисања: 2(-)
diff --git a/util.h b/util.h
@@ -56,9 +56,9 @@
#define ENSURE_SIZE(to, temp, tosize, testsize, fromsize, label, type) \
do \
{ \
- if (!to || tosize < testsize) \
+ if (!(to) || (tosize) < (testsize)) \
{ \
- temp = realloc(to, fromsize * sizeof(type)); \
+ temp = realloc(to, (fromsize) * sizeof(type)); \
if (!temp) \
{ \
char* ctemp = NULL; \