chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
util: introduce memdup()
[elogind.git]
/
src
/
shared
/
util.h
diff --git
a/src/shared/util.h
b/src/shared/util.h
index c487b702bf6d14c96131e3434f0d54a4b7ede9ed..efb2c7d324afa0858212c6922ad09c52e401cd9a 100644
(file)
--- a/
src/shared/util.h
+++ b/
src/shared/util.h
@@
-100,6
+100,8
@@
bool streq_ptr(const char *a, const char *b);
#define new0(t, n) ((t*) calloc((n), sizeof(t)))
+#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n))
+
#define malloc0(n) (calloc((n), 1))
static inline const char* yes_no(bool b) {