Rivoreo Source Code Repositories
src.rivoreo.one
/
devel
/
nativetools
/
523b3935a5c6aee43b532e87c75fd916a03d9bf2
/
.
/
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
;
}