From: Thomas Hindoe Paaboel Andersen Date: Fri, 28 Aug 2015 19:16:39 +0000 (+0200) Subject: util: make malloc0 ask calloc for one block of size n X-Git-Tag: v226~73^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f80bb1f7eaf31476a44c2093d3ee02aba817a0b0;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/util.h b/src/basic/util.h index 1ead7b5419b..1484ef58e53 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);