X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhtest.c;h=298ef039dc00f0973cfa2a613816f7fbc33aef91;hp=90f733739983995d20a886e2fb96dd0e3ce43414;hb=1bb1f6c3f38b05060bf699ea2743f7386889bf63;hpb=8f4c5da8971926f7eccc912f7998c343aef3c33b diff --git a/uip/mhtest.c b/uip/mhtest.c index 90f7337..298ef03 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -3,6 +3,10 @@ * mhtest.c -- test harness for MIME routines * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include @@ -11,11 +15,12 @@ #include #include #include -#include +#include #include #include #include #include +#include #ifdef HAVE_SYS_WAIT_H # include @@ -63,8 +68,6 @@ static struct swit switches[] = { }; -extern int errno; - int ebcdicsw = 0; /* hack for linking purposes */ /* mhparse.c */ @@ -147,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 @@ -250,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; }