X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fscan.c;h=705ff69b6a1d072dc9fbb9250bef3bd806fc5dec;hb=3465392f2ac1ac472d44c10c3c989389421c82b2;hp=02621dc56d1eaa6be9c15e70dac3890d158b57d3;hpb=4885712264980e6cbc2039f9158027bee9213475;p=mmh diff --git a/uip/scan.c b/uip/scan.c index 02621dc..705ff69 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -14,6 +14,7 @@ #include #include #include +#include #include /* @@ -96,8 +97,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 @@ -177,9 +177,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; }