Sign in
fuchsia
/
zircon
/
/
13ee3dc5e4c46bf127977ad28645c47442ec517d
/
.
/
third_party
/
ulib
/
musl
/
src
/
string
/
strdup.c
blob: 0eb8093177f012bffb982a4aa945c208d7e78566 [
file
] [
log
] [
blame
]
#include
"libc.h"
#include
<stdlib.h>
#include
<string.h>
char
*
__strdup
(
const
char
*
s
)
{
size_t
l
=
strlen
(
s
);
char
*
d
=
malloc
(
l
+
1
);
if
(!
d
)
return
NULL
;
return
memcpy
(
d
,
s
,
l
+
1
);
}
weak_alias
(
__strdup
,
strdup
);