projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3175a7
)
util: introduce memdup()
author
Lennart Poettering
<lennart@poettering.net>
Mon, 16 Apr 2012 16:54:45 +0000
(18:54 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 16 Apr 2012 16:59:08 +0000
(18:59 +0200)
src/shared/util.h
patch
|
blob
|
history
diff --git
a/src/shared/util.h
b/src/shared/util.h
index
c487b70
..
efb2c7d
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) {