X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6c42153ad9362cc676ea66563bf400d7511b3b68..b8ca332a9752c9de52613a229d95eb7c4c15ac20:/uip/mhpath.c diff --git a/uip/mhpath.c b/uip/mhpath.c index d3dcc675..4a88605b 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; }