Sign in
cobalt
/
cobalt
/
25902c6cb1ab9cfd8ae2ee6b0fb52953f73deda5
/
.
/
third_party
/
musl
/
src
/
string
/
wcsdup.c
blob: f398e8091c382e7616def68d663a3bf8d33448d6 [
file
] [
log
] [
blame
]
#include
<stdlib.h>
#include
<wchar.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
);
}