Rivoreo Source Code Repositories
src.rivoreo.one
/
devel
/
nativetools
/
031bc2aeecaaf6d703c63636ba124071883d73b3
/
.
/
nativelibc
/
string
/
strdup.c
blob: af61f5a0f3e3fce08258d425e25a23ee4e752f09 [
file
] [
log
] [
blame
] [
raw
]
#include
<string.h>
#include
<stdlib.h>
char
*
strdup
(
const
char
*
str
)
{
size_t
len
=
strlen
(
str
)
+
1
;
char
*
copy
=
malloc
(
len
);
if
(
copy
)
memcpy
(
copy
,
str
,
len
);
return
copy
;
}