X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhtest.c;h=298ef039dc00f0973cfa2a613816f7fbc33aef91;hp=80a0c7b3fdbce4c51c6c4212e2d50140071c880f;hb=008837e090c008e3afe7a9c8667070bafa091e62;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/uip/mhtest.c b/uip/mhtest.c index 80a0c7b..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 @@ -52,7 +57,7 @@ static struct swit switches[] = { #define VERSIONSW 10 { "version", 0 }, #define HELPSW 11 - { "help", 4 }, + { "help", 0 }, /* * switches for debugging @@ -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; } @@ -386,8 +387,7 @@ do_cache: context_save (); /* save the context file */ } - done (0); - /* NOTREACHED */ + return done (0); } @@ -421,7 +421,7 @@ pipeser (int i) } -void +int done (int status) { CT *ctp; @@ -431,4 +431,5 @@ done (int status) free_content (*ctp); exit (status); + return 1; /* dead code to satisfy the compiler */ }