* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / mhtest.c
index a7d2d38..9219839 100644 (file)
@@ -20,6 +20,7 @@
 #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>
@@ -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