From e0614f7cd418afedd06c9bcd5abb965608bc52f8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 1 Mar 2012 23:24:45 -0500 Subject: add all missing wchar functions except floating point parsers these are mostly untested and adapted directly from corresponding byte string functions and similar. --- src/string/wcsdup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/string/wcsdup.c (limited to 'src/string/wcsdup.c') diff --git a/src/string/wcsdup.c b/src/string/wcsdup.c new file mode 100644 index 00000000..dd49c1b6 --- /dev/null +++ b/src/string/wcsdup.c @@ -0,0 +1,11 @@ +#include +#include +#include "libc.h" + +wchar_t *wcsdup(const wchar_t *s) +{ + size_t l = wcslen(s); + wchar_t *d = malloc((l+1)*sizeof(wchar_t)); + if (!d) return NULL; + return wmemcpy(d, s, l+1); +} -- cgit v1.2.1