Skip to content

Commit

Permalink
wrap multistatement macro in do/while
Browse files Browse the repository at this point in the history
  • Loading branch information
imyxh committed Jul 24, 2024
1 parent abb902c commit 5f244f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libaylp/xalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5f244f0

Please sign in to comment.