From 7b3edf97dca4aab8fc34209633c41a9d363b2a71 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Fri, 28 Aug 2015 21:16:39 +0200 Subject: [PATCH] util: make malloc0 ask calloc for one block of size n ... instead of an array of n individual bytes. Silences a lot of warnings in smatch. --- src/basic/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/util.h b/src/basic/util.h index 1245b39f7..d7744a7d4 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -83,7 +83,7 @@ int strcmp_ptr(const char *a, const char *b) _pure_; #define newdup(t, p, n) ((t*) memdup_multiply(p, sizeof(t), (n))) -#define malloc0(n) (calloc((n), 1)) +#define malloc0(n) (calloc(1, (n))) static inline void *mfree(void *memory) { free(memory); -- 2.30.2