aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-12-17 02:09:51 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-12-17 02:09:51 +0000
commit0922eb1ccb33983bd4ad2d5c38475d56e2e60137 (patch)
tree5d4e126da335d88279e0447feb988a5816f29a63 /xmalloc.c
parentd4009e757f45a4f09bd415cc032b079f316b4c46 (diff)
downloadfetchmail-0922eb1ccb33983bd4ad2d5c38475d56e2e60137.tar.gz
fetchmail-0922eb1ccb33983bd4ad2d5c38475d56e2e60137.tar.bz2
fetchmail-0922eb1ccb33983bd4ad2d5c38475d56e2e60137.zip
Use error() for messages almost everywhere.
svn path=/trunk/; revision=636
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/xmalloc.c b/xmalloc.c
index d9726618..3c231294 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -6,6 +6,7 @@
#include <config.h>
#include <stdio.h>
+#include <errno.h>
#include <string.h>
#if defined(STDC_HEADERS)
#include <stdlib.h>
@@ -24,10 +25,8 @@ xmalloc (int n)
XMALLOCTYPE *p;
p = (XMALLOCTYPE *) malloc(n);
- if (p == (XMALLOCTYPE *) 0) {
- fputs("fetchmail: malloc failed\n",stderr);
- exit(PS_UNDEFINED);
- }
+ if (p == (XMALLOCTYPE *) 0)
+ error(PS_UNDEFINED, errno, "malloc failed");
return(p);
}