Sign in
googlers
/
maze
/
klibc
/
dab0d3a353c07cd89914ae324c4ca1108bcb6d4d
/
.
/
klibc
/
strdup.c
blob: eb170c2645dd53910cb0021b3601ec206e3087dc [
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
;
}