Commit a0e37e77 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

util: Add xstrdup helper

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 80356736
......@@ -159,6 +159,7 @@ int close_safe(int *fd);
___p; \
})
#define xstrdup(str) __xalloc(strdup, strlen(str) + 1, str)
#define xmalloc(size) __xalloc(malloc, size, size)
#define xzalloc(size) __xalloc(calloc, size, 1, size)
#define xrealloc(p, size) __xalloc(realloc, size, p, size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment