]> diplodocus.org Git - nmh/blobdiff - sbr/folder_delmsgs.c
dtimezone(): Explain abs(3) is undefined on INT_MIN.
[nmh] / sbr / folder_delmsgs.c
index ebbca2d48cfef6ab8ec5ef7fbb75e8d3e2aba906..e5b6ae282d745fd7950f3e92aacabc4d7e79ef6c 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * folder_delmsgs.c -- "remove" SELECTED messages from a folder
+/* folder_delmsgs.c -- "remove" SELECTED messages from a folder
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -9,6 +7,7 @@
 
 #include <h/mh.h>
 #include <h/utils.h>
+#include "m_mktemp.h"
 
 /*
  * 1) If we are using an external rmmproc, then exec it.
@@ -57,11 +56,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook)
         */
 
        if (mp->numsel + vecp + 1 > MAXARGS)
-           vec = (char **) mh_xrealloc (vec,
-                                         (size_t) ((mp->numsel + vecp + 1) *
-                                                    sizeof(*vec)));
-       if (vec == NULL)
-           adios (NULL, "unable to allocate exec vector");
+           vec = mh_xrealloc(vec, (mp->numsel + vecp + 1) * sizeof *vec);
        for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
            if (is_selected (mp, msgnum) &&
                !(vec[vecp++] = strdup (m_name (msgnum))))
@@ -107,7 +102,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook)
 
            if (!nohook) {
                    (void)snprintf(msgpath, sizeof (msgpath), "%s/%d", mp->foldpath, msgnum);
-                   (void)ext_hook("del-hook", msgpath, (char *)0);
+                   (void)ext_hook("del-hook", msgpath, NULL);
                }
 
            dp = m_name (msgnum);