Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
6651ef1f060738ee1f50cac1fe6d8ce64c359022
/
.
/
src
/
string
/
wcsdup.c
blob: dd49c1b6297f695d7aea4fd4c8f586b2dff0c5da [
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
);
}