X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhpath.c;h=4a88605b8434025da8134453aec4f3766cea48a8;hp=d3dcc675b5a250423b1f6e6e025c97f5c2b905dc;hb=389877bae1fe1a9f7259b8979f6a930744d90fab;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/uip/mhpath.c b/uip/mhpath.c index d3dcc67..4a88605 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -10,6 +10,7 @@ */ #include +#include static struct swit switches[] = { #define VERSIONSW 0 @@ -52,8 +53,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 @@ -89,9 +89,8 @@ main(int argc, char **argv) */ 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; }