X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/d9b1d57351d104d7ec1a5621f090657dcce8cb7f..8e0d377cb731b0fbc39a9b2874ec6b772e53620b:/uip/anno.c diff --git a/uip/anno.c b/uip/anno.c index dca93eb5..9fbb37f5 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -46,6 +46,7 @@ */ #include +#include /* * We allocate space for messages (msgs array) @@ -127,8 +128,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))); while ((cp = *argp++)) { if (*cp == '-') { @@ -233,9 +233,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; }