diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-10 02:58:25 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-10 02:58:25 +0100 |
commit | 344273a7e0a6899451836e6072fecebea4a6ac24 (patch) | |
tree | ea24fa9e12ae6dad40eeb6470c92545e14f0f8cf /src/mds-kbdc/string.c | |
parent | no more direct allocations, always use macros, unless using alloca (diff) | |
download | mds-344273a7e0a6899451836e6072fecebea4a6ac24.tar.gz mds-344273a7e0a6899451836e6072fecebea4a6ac24.tar.bz2 mds-344273a7e0a6899451836e6072fecebea4a6ac24.tar.xz |
add xmemdup macro
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-kbdc/string.c')
-rw-r--r-- | src/mds-kbdc/string.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mds-kbdc/string.c b/src/mds-kbdc/string.c index 6ecf757..843757b 100644 --- a/src/mds-kbdc/string.c +++ b/src/mds-kbdc/string.c @@ -145,8 +145,7 @@ char32_t* string_dup(const char32_t* restrict string) if (string == NULL) return NULL; n = string_length(string) + 1; - fail_if (xmalloc(rc, n, char32_t)); - memcpy(rc, string, n * sizeof(char32_t)); + fail_if (xmemdup(rc, string, n, char32_t)); return rc; fail: return NULL; |