2 * xmalloc.c -- allocate space or die
4 * For license terms, see the file COPYING in this directory.
6 * i18n by Arnaldo Carvalho de Melo <acme@conectiva.com.br> 7-Nov-1998
13 #if defined(STDC_HEADERS)
16 #include "fetchmail.h"
19 #if defined(HAVE_VOIDPOINTER)
20 #define XMALLOCTYPE void
22 #define XMALLOCTYPE char
30 p = (XMALLOCTYPE *) malloc(n);
31 if (p == (XMALLOCTYPE *) 0)
32 error(PS_UNDEFINED, errno, _("malloc failed"));
37 xrealloc (XMALLOCTYPE *p, int n)
41 p = (XMALLOCTYPE *) realloc(p, n);
42 if (p == (XMALLOCTYPE *) 0)
43 error(PS_UNDEFINED, errno, _("realloc failed"));
47 char *xstrdup(const char *s)
50 p = (char *) xmalloc(strlen(s)+1);
55 /* xmalloc.c ends here */