X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv.git;a=blobdiff_plain;f=both.c;h=9fe88e962744a071b476408b935edbcfff06a8a0;hp=46cf85c73823f1ae16b49b2254a38f1f67c12faf;hb=cb7e2d8c1171b8a2d362d4d1a2efe9c2e650f044;hpb=b6c671fd90134d458ad4722ec3a99742bced1a34 diff --git a/both.c b/both.c index 46cf85c..9fe88e9 100644 --- a/both.c +++ b/both.c @@ -30,9 +30,32 @@ #include #include #include +#include +#include "config.h" #include "both.h" +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; +} + +char *xstrsave(const char *s) { + char *r; + + r= xmalloc(strlen(s)+1); + strcpy(r,s); + return r; +} + + int working_getc(FILE *file) { int c;