X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhlist.c;h=03480b3cc88a456bcd610d346beb2971c1d1e42d;hp=10ba1e4c35b8f7aefafca7e30482914443bdd1d9;hb=1513f7668c494c4583141d6115669b7198c14556;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/uip/mhlist.c b/uip/mhlist.c index 10ba1e4..03480b3 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef HAVE_SYS_WAIT_H # include @@ -73,8 +74,6 @@ static struct swit switches[] = { }; -extern int errno; - /* mhparse.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ @@ -155,8 +154,7 @@ main (int argc, char **argv) */ nummsgs = 0; maxmsgs = MAXMSGS; - if (!(msgs = (char **) malloc ((size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to allocate storage"); + msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs))); /* * Parse arguments @@ -266,9 +264,8 @@ do_cache: */ if (nummsgs >= maxmsgs) { maxmsgs += MAXMSGS; - if (!(msgs = (char **) realloc (msgs, - (size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to reallocate msgs storage"); + msgs = (char **) mh_xrealloc (msgs, + (size_t) (maxmsgs * sizeof(*msgs))); } msgs[nummsgs++] = cp; }