aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmalloc.c b/xmalloc.c
index 2b343fe4..4cd9d40e 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -57,4 +57,14 @@ char *xstrdup(const char *s)
return p;
}
+#if !defined(HAVE_STRDUP)
+char *strdup(const char *s)
+{
+ char *p;
+ p = (char *) malloc(strlen(s)+1);
+ strcpy(p,s);
+ return p;
+}
+#endif /* !HAVE_STRDUP */
+
/* xmalloc.c ends here */