X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fanno.c;h=9fbb37f521e0b44e2aa39a28565b4041370a3c80;hp=dca93eb5ee63579c82f73f76f263b065ad6ace5f;hb=1513f7668c494c4583141d6115669b7198c14556;hpb=d9b1d57351d104d7ec1a5621f090657dcce8cb7f diff --git a/uip/anno.c b/uip/anno.c index dca93eb..9fbb37f 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; }