diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-12-17 02:09:51 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-12-17 02:09:51 +0000 |
commit | 0922eb1ccb33983bd4ad2d5c38475d56e2e60137 (patch) | |
tree | 5d4e126da335d88279e0447feb988a5816f29a63 /xmalloc.c | |
parent | d4009e757f45a4f09bd415cc032b079f316b4c46 (diff) | |
download | fetchmail-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.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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); } |