1 #include "ntp_malloc.h" 2 3 #if !HAVE_STRDUP 4 5 #define NULL 0 6 7 char *strdup(const char *s); 8 9 char * 10 strdup( 11 const char *s 12 ) 13 { 14 char *cp; 15 16 if (s) { 17 cp = (char *) malloc((unsigned) (strlen(s)+1)); 18 if (cp) { 19 (void) strcpy(cp, s); 20 } 21 } else { 22 cp = (char *) NULL; 23 } 24 return(cp); 25 } 26 #else 27 int strdup_bs; 28 #endif 29