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