X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fscan.c;h=705ff69b6a1d072dc9fbb9250bef3bd806fc5dec;hp=02621dc56d1eaa6be9c15e70dac3890d158b57d3;hb=d2da15ecabb03fb2de72863abdf5f21e52fdf329;hpb=4885712264980e6cbc2039f9158027bee9213475 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; }