* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / mhtest.c
index 4bc9245..9219839 100644 (file)
@@ -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 <h/mh.h>
 #include <h/md5.h>
 #include <errno.h>
 #include <signal.h>
-#include <zotnet/mts/mts.h>
-#include <zotnet/tws/tws.h>
+#include <h/mts.h>
+#include <h/tws.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
+#include <h/utils.h>
 
 #ifdef HAVE_SYS_WAIT_H
 # include <sys/wait.h>
@@ -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