chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
969cc7c
)
util: make malloc0 ask calloc for one block of size n
author
Thomas Hindoe Paaboel Andersen
<phomes@gmail.com>
Fri, 28 Aug 2015 19:16:39 +0000
(21:16 +0200)
committer
Sven Eden
<yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:19:06 +0000
(10:19 +0100)
... instead of an array of n individual bytes.
Silences a lot of warnings in smatch.
src/basic/util.h
patch
|
blob
|
history
diff --git
a/src/basic/util.h
b/src/basic/util.h
index 1245b39f744fce4e001907018f1a71f454f34edc..d7744a7d47d7f26256df4187320d77ea75de42a9 100644
(file)
--- 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);