summaryrefslogtreecommitdiff
path: root/lib/bind/bsd/strdup.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2008-07-12 05:47:40 +0000
committerPeter Wemm <peter@FreeBSD.org>2008-07-12 05:47:40 +0000
commita2fb3b4fea07ff46e8b265b9495d82380edfc484 (patch)
tree06bae50e9f9d87fa78e718cf3dd1669ebc994a16 /lib/bind/bsd/strdup.c
parentfa5fb0343e2347012cf980b8273e2cba6c36de4a (diff)
Notes
Diffstat (limited to 'lib/bind/bsd/strdup.c')
-rw-r--r--lib/bind/bsd/strdup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/bind/bsd/strdup.c b/lib/bind/bsd/strdup.c
new file mode 100644
index 000000000000..246bc1f49fc2
--- /dev/null
+++ b/lib/bind/bsd/strdup.c
@@ -0,0 +1,18 @@
+#include "port_before.h"
+
+#include <stdlib.h>
+
+#include "port_after.h"
+
+#ifndef NEED_STRDUP
+int __bind_strdup_unneeded;
+#else
+char *
+strdup(const char *src) {
+ char *dst = malloc(strlen(src) + 1);
+
+ if (dst)
+ strcpy(dst, src);
+ return (dst);
+}
+#endif