util: introduce memdup()

This commit is contained in:
Lennart Poettering 2012-04-16 18:54:45 +02:00
parent c3175a7f40
commit 888c710235

View file

@ -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) {