summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-16 18:54:45 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-16 18:59:08 +0200
commit888c7102355af1450aa26253d60cc2cb46eeb71d (patch)
tree9bfddf2d0b5c46550ee8e7ac60759c030ad8172e /src/shared
parentc3175a7f40a2d2fabc3a2de63033a6810d45221a (diff)
util: introduce memdup()
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index c487b702bf..efb2c7d324 100644
--- 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) {