Sign in
fuchsia
/
fuchsia
/
refs/heads/releases/canary
/
.
/
zircon
/
third_party
/
ulib
/
musl
/
src
/
string
/
wcsdup.c
blob: bc2a41a127f4e35ec3e6a42a9d1e725e26dfd9a0 [
file
] [
log
] [
blame
]
#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
);
}