xref: /titanic_50/usr/src/lib/libresolv2/common/bsd/strdup.c (revision 24dd95375a09d43fe4f6b55f6d5188f4bac4f68d)
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