xref: /titanic_50/usr/src/lib/libresolv2/common/bsd/strdup.c (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
1 /*
2  * Copyright (c) 1997, by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 
7 #pragma ident	"%Z%%M%	%I%	%E% SMI"
8 
9 #include "port_before.h"
10 
11 #include <stdlib.h>
12 
13 #include "port_after.h"
14 
15 #ifndef NEED_STRDUP
16 int __bind_strdup_unneeded;
17 #else
18 char *
19 strdup(const char *src) {
20 	char *dst = malloc(strlen(src) + 1);
21 
22 	if (dst)
23 		strcpy(dst, src);
24 	return (dst);
25 }
26 #endif
27