aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/strdup.c
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
committerOllivier Robert <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
commit224ba2bd37e182b64f7d78defef8a6cacaad3415 (patch)
tree3cfb63f1a112ee17469b17fc1593a88d004ddda6 /contrib/ntp/libntp/strdup.c
parent1c80946020d06ca926154926c7c890d211708395 (diff)
downloadsrc-224ba2bd37e182b64f7d78defef8a6cacaad3415.tar.gz
src-224ba2bd37e182b64f7d78defef8a6cacaad3415.zip
Virgin import of ntpd 4.1.0
Notes
Notes: svn path=/vendor/ntp/dist/; revision=82498
Diffstat (limited to 'contrib/ntp/libntp/strdup.c')
-rw-r--r--contrib/ntp/libntp/strdup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/ntp/libntp/strdup.c b/contrib/ntp/libntp/strdup.c
new file mode 100644
index 000000000000..08ffc2ff031e
--- /dev/null
+++ b/contrib/ntp/libntp/strdup.c
@@ -0,0 +1,20 @@
+
+#define NULL 0
+
+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);
+}