Sign in
gnu
/
gcc
/
0b9db4a2b3be0105812104f4b6f9a4c310b3e1b1
/
.
/
libiberty
/
strdup.c
blob: 1785b34f2745a1e43d61cf42bbec1862506dd2fb [
file
] [
log
] [
blame
]
char
*
strdup
(
s
)
char
*
s
;
{
char
*
result
=
(
char
*)
malloc
(
strlen
(
s
)
+
1
);
if
(
result
==
(
char
*)
0
)
return
(
char
*)
0
;
strcpy
(
result
,
s
);
return
result
;
}