aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/xmalloc.c b/xmalloc.c
index 3679b508..9ea57c41 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -13,6 +13,7 @@
#include <config.h>
#include <stdio.h>
+#include <string.h>
#include <sys/types.h>
#include "fetchmail.h"
@@ -24,7 +25,7 @@
XMALLOCTYPE *
xmalloc (n)
-size_t n;
+int n;
{
XMALLOCTYPE *p;
@@ -35,3 +36,12 @@ size_t n;
}
return(p);
}
+
+char *xstrdup(s)
+char *s;
+{
+ char *p;
+ p = (char *) xmalloc(strlen(s)+1);
+ strcpy(p,s);
+ return p;
+}