Cross Reference: strdup.c
xref
: /
osnet-11
/
usr
/
src
/
lib
/
libresolv2
/
common
/
bsd
/
strdup.c
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
strdup.c revision 2
2
N/A
#
include
"
port_before.h
"
2
N/A
2
N/A
#
include
<
stdlib.h
>
2
N/A
2
N/A
#
include
"
port_after.h
"
2
N/A
2
N/A
#
ifndef
NEED_STRDUP
2
N/A
int
__bind_strdup_unneeded
;
2
N/A
#
else
2
N/A
char
*
2
N/A
strdup
(
const
char
*
src
) {
2
N/A
char
*
dst
=
malloc
(
strlen
(
src
) +
1
);
2
N/A
2
N/A
if
(
dst
)
2
N/A
strcpy
(
dst
,
src
);
2
N/A
return
(
dst
);
2
N/A
}
2
N/A
#
endif
2
N/A
2
N/A
/*! \file */