* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / rmm.c
index a18c278..b25f083 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -10,6 +10,7 @@
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 
 /*
  * We allocate space for message names and ranges
@@ -56,8 +57,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 */
     while ((cp = *argp++)) {
@@ -145,7 +145,7 @@ main (int argc, char **argv)
     }
 
     /* "remove" the SELECTED messages */
-    folder_delmsgs (mp, unlink_msgs);
+    folder_delmsgs (mp, unlink_msgs, 0);
 
     seq_save (mp);             /* synchronize message sequences  */
     context_replace (pfolder, folder); /* update current folder   */