diff options
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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; +} |