summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/strdup.c
diff options
context:
space:
mode:
authorroberto <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
committerroberto <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
commit40b8e415eb0f835a9dd7a473ddf134ec67877fd7 (patch)
tree3cfb63f1a112ee17469b17fc1593a88d004ddda6 /contrib/ntp/libntp/strdup.c
parenta5a8dc6136fcee95f261a31609a25669038c3861 (diff)
downloadFreeBSD-src-40b8e415eb0f835a9dd7a473ddf134ec67877fd7.zip
FreeBSD-src-40b8e415eb0f835a9dd7a473ddf134ec67877fd7.tar.gz
Virgin import of ntpd 4.1.0
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 0000000..08ffc2f
--- /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);
+}
OpenPOWER on IntegriCloud