X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv.git;a=blobdiff_plain;f=lib.c;h=1352afa24d74fedcf48c2f369ebda1187f5ec33e;hp=22c8cd1750a52af1855b242104191d6abb3028a1;hb=949af4df9625f3371e146f7c78f4f1a17a2bf6db;hpb=c7ad3b51358d0b7704e5670d973ad1a376caf4e1 diff --git a/lib.c b/lib.c index 22c8cd1..1352afa 100644 --- a/lib.c +++ b/lib.c @@ -31,6 +31,7 @@ #include "config.h" #include "common.h" #include "lib.h" +#include "both.h" char *xstrcat3save(const char *a, const char *b, const char *c) { char *r; @@ -42,14 +43,6 @@ char *xstrcat3save(const char *a, const char *b, const char *c) { return r; } -char *xstrsave(const char *s) { - char *r; - - r= xmalloc(strlen(s)+1); - strcpy(r,s); - return r; -} - char *xstrsubsave(const char *begin, int len) { char *r; @@ -59,17 +52,6 @@ char *xstrsubsave(const char *begin, int len) { return r; } -void *xmalloc(size_t s) { - void *p; - p= malloc(s?s:1); if (!p) syscallerror("malloc"); - return p; -} - -void *xrealloc(void *p, size_t s) { - p= realloc(p,s); if (!p) syscallerror("realloc"); - return p; -} - int makeroom(char **buffer, int *size, int needed) { if (needed > MAX_GENERAL_STRING) return -1; if (*size >= needed) return 0;