aboutsummaryrefslogtreecommitdiff
path: root/xmalloc.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-09 17:43:04 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-09 17:43:04 +0000
commit8aba25a477b91bfae213a8247e364bf4e7cddb69 (patch)
tree2e61883b4af1360f88b1bb71360e810c1a768e8c /xmalloc.c
parentchangelog: add contributor (diff)
xmalloc: add xwcsdup()
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xmalloc.c b/xmalloc.c
index c90b97dc..a9a6685c 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
#include <syslog.h>
#include "xmalloc.h"
@@ -54,6 +55,12 @@ xstrdup(const char *str)
return check_alloc(strdup(str));
}
+wchar_t *
+xwcsdup(const wchar_t *str)
+{
+ return check_alloc(wcsdup(str));
+}
+
char *
xstrndup(const char *str, size_t n)
{