aboutsummaryrefslogtreecommitdiffstats
path: root/libntp/strdup.c
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2008-08-17 17:37:33 +0000
committerOllivier Robert <roberto@FreeBSD.org>2008-08-17 17:37:33 +0000
commitcce65f439697627afbccf5a67035a957bb4d784a (patch)
tree16d100fbc9dae63888d48b464e471ba0e5065193 /libntp/strdup.c
parent8c24a1e0ffd629427f94da1b681600008030c41a (diff)
downloadsrc-cce65f439697627afbccf5a67035a957bb4d784a.tar.gz
src-cce65f439697627afbccf5a67035a957bb4d784a.zip
Flatten the dist and various 4.n.n trees in preparation of future ntp imports.
Notes
Notes: svn path=/vendor/ntp/dist/; revision=181800
Diffstat (limited to 'libntp/strdup.c')
-rw-r--r--libntp/strdup.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libntp/strdup.c b/libntp/strdup.c
new file mode 100644
index 000000000000..2e26ba7a51e4
--- /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