From 4ded1c1fa0bc21c61f91a2dbe864835986745121 Mon Sep 17 00:00:00 2001 From: roberto Date: Sun, 17 Aug 2008 17:37:33 +0000 Subject: Flatten the dist and various 4.n.n trees in preparation of future ntp imports. --- libntp/strdup.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 libntp/strdup.c (limited to 'libntp/strdup.c') diff --git a/libntp/strdup.c b/libntp/strdup.c new file mode 100644 index 0000000..2e26ba7 --- /dev/null +++ b/libntp/strdup.c @@ -0,0 +1,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 -- cgit v1.1