Sign in
android
/
platform
/
external
/
musl
/
refs/heads/android13-d4-release
/
.
/
src
/
string
/
strdup.c
blob: d4c274494f654e2fe04ce7384431f5dfdb817c03 [
file
] [
log
] [
blame
] [
edit
]
#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
);
}