mirror of
https://github.com/fluencelabs/musl
synced 2025-06-11 05:51:48 +00:00
these are mostly untested and adapted directly from corresponding byte string functions and similar.
12 lines
214 B
C
12 lines
214 B
C
#include <stdlib.h>
|
|
#include <wchar.h>
|
|
#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);
|
|
}
|