2 * xmalloc.c -- allocate space or die
4 * Copyright 1998 by Eric S. Raymond.
5 * For license terms, see the file COPYING in this directory.
12 #if defined(STDC_HEADERS)
15 #include "fetchmail.h"
18 #if defined(HAVE_VOIDPOINTER)
19 #define XMALLOCTYPE void
21 #define XMALLOCTYPE char
29 p = (XMALLOCTYPE *) malloc(n);
30 if (p == (XMALLOCTYPE *) 0)
32 report(stderr, _("malloc failed\n"));
39 xrealloc (XMALLOCTYPE *p, int n)
43 p = (XMALLOCTYPE *) realloc(p, n);
44 if (p == (XMALLOCTYPE *) 0)
46 report(stderr, _("realloc failed\n"));
52 char *xstrdup(const char *s)
55 p = (char *) xmalloc(strlen(s)+1);
60 /* xmalloc.c ends here */