X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;ds=sidebyside;f=uip%2Fmhtest.c;h=298ef039dc00f0973cfa2a613816f7fbc33aef91;hb=1bb1f6c3f38b05060bf699ea2743f7386889bf63;hp=a7d2d383eb0ba6db16e1e0cd7750faf7ff94fbbd;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/uip/mhtest.c b/uip/mhtest.c index a7d2d38..298ef03 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef HAVE_SYS_WAIT_H # include @@ -67,8 +68,6 @@ static struct swit switches[] = { }; -extern int errno; - int ebcdicsw = 0; /* hack for linking purposes */ /* mhparse.c */ @@ -151,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 @@ -254,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; }