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.
14 #include "fetchmail.h"
17 void *xmalloc (size_t n)
21 p = (void *) malloc(n);
24 report(stderr, GT_("malloc failed\n"));
30 void *xrealloc (void *p, size_t n)
34 p = (void *) realloc(p, n);
37 report(stderr, GT_("realloc failed\n"));
43 char *xstrdup(const char *s)
46 p = (char *) xmalloc(strlen(s)+1);
51 char *xstrndup(const char *s, size_t len)
57 p = (char *)xmalloc(l + 1);
64 /* xmalloc.c ends here */