X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhtest.c;h=298ef039dc00f0973cfa2a613816f7fbc33aef91;hp=4bc92454ea7883741bb76dd0c05c7c191e2d9ed5;hb=5ff96d61ee5af34956ae958a0bc72ee78734a4d7;hpb=017a82124bf2ea39ced5aa4c8f969c18b3c2fb90 diff --git a/uip/mhtest.c b/uip/mhtest.c index 4bc9245..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 +#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; }