From 5f244f063d980033d67605d8b626697703f17b32 Mon Sep 17 00:00:00 2001 From: Ivy Huang Date: Wed, 24 Jul 2024 03:09:39 -0400 Subject: [PATCH] wrap multistatement macro in do/while --- libaylp/xalloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libaylp/xalloc.h b/libaylp/xalloc.h index 2929d9c..20c3c97 100644 --- a/libaylp/xalloc.h +++ b/libaylp/xalloc.h @@ -19,7 +19,7 @@ void *alloc_check(void *ptr); #define xcalloc_type(type, ...) \ (type *)alloc_check(type##_calloc(__VA_ARGS__)) #define xfree_type(type, ptr) \ - type##_free(ptr); ptr=0 + do { type##_free(ptr); ptr=0; } while (0) char *xstrdup(const char *str);