Sign in
llvm
/
llvm-archive
/
c985600a5f75bb4fc6588e042cd66ae5c36798c8
/
.
/
poolalloc
/
runtime
/
PreRT
/
strdup.c
blob: f40e8755a0357ec91f4dcd2d7353812e9e8afd69 [
file
] [
log
] [
blame
]
#include
<stdlib.h>
#include
<string.h>
#undef
strdup
char
*
strdup
(
const
char
*
s
)
{
size_t
len
=
strlen
(
s
)
+
1
;
void
*
new
=
malloc
(
len
);
if
(
new
==
NULL
)
return
NULL
;
return
(
char
*)
memcpy
(
new
,
s
,
len
);
}