Sign in
kernel
/
pub
/
scm
/
linux
/
kernel
/
git
/
bwh
/
klibc
/
201dabf78546ca712d3541670a5d898dc199854e
/
.
/
usr
/
klibc
/
strdup.c
blob: 905b51de520f489439b4aff8692791dc6e3941b4 [
file
] [
log
] [
blame
]
/*
* strdup.c
*/
#include
<string.h>
#include
<stdlib.h>
char
*
strdup
(
const
char
*
s
)
{
int
l
=
strlen
(
s
)
+
1
;
char
*
d
=
malloc
(
l
);
if
(
d
)
memcpy
(
d
,
s
,
l
);
return
d
;
}