]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: make malloc0 ask calloc for one block of size n 1073/head
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 28 Aug 2015 19:16:39 +0000 (21:16 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sun, 30 Aug 2015 00:32:33 +0000 (02:32 +0200)
... instead of an array of n individual bytes.

Silences a lot of warnings in smatch.

src/basic/util.h

index 1ead7b5419b3fda7971003cc4a217122550a6f76..1484ef58e53c39f3658b12cdcf0bbad27c741df7 100644 (file)
@@ -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);