]> diplodocus.org Git - nmh/blobdiff - sbr/folder_delmsgs.c
Escape literal leading full stop in man/new.man.
[nmh] / sbr / folder_delmsgs.c
index db593f805134e20011863b86c3aa14193423d2af..94aa29ce0fadfa526beadae9e5cb79e97e686e4b 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 
 /*
  * 1) If we are using an external rmmproc, then exec it.
@@ -56,10 +57,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook)
         */
 
        if (mp->numsel + vecp + 1 > MAXARGS)
-           vec = (char **) realloc (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))))
@@ -105,7 +103,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);