1#include "ntp_malloc.h" 2 3#if !HAVE_STRDUP 4 5#define NULL 0 6 7char *strdup(const char *s); 8 9char * 10strdup( 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 27int strdup_bs; 28#endif 29