summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index a3f0c6fb..fbabda77 100644
--- a/lib.c
+++ b/lib.c
@@ -1926,6 +1926,14 @@ wchar_t *chk_strdup(const wchar_t *str)
return copy;
}
+char *chk_strdup_utf8(const char *str)
+{
+ size_t nchar = strlen(str) + 1;
+ char *copy = coerce(char *, chk_malloc(nchar));
+ assert (!async_sig_enabled);
+ memcpy(copy, str, nchar);
+ return copy;
+}
val cons(val car, val cdr)
{