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