X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhtest.c;h=298ef039dc00f0973cfa2a613816f7fbc33aef91;hb=0cebd8284370988c8b1807ef2544bd80804d074e;hp=46c86ac20ae84d12c46a07e13613f3b06958f60a;hpb=4885712264980e6cbc2039f9158027bee9213475;p=mmh diff --git a/uip/mhtest.c b/uip/mhtest.c index 46c86ac..298ef03 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef HAVE_SYS_WAIT_H # include @@ -149,8 +150,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 @@ -252,9 +252,8 @@ do_cache: */ 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; }