X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6bc64765f773ce75454ec1592a86779e3547fe46..665dfc96:/sbr/folder_delmsgs.c?ds=sidebyside diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index db593f80..92c7ca39 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -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 @@ -8,6 +6,7 @@ */ #include +#include /* * 1) If we are using an external rmmproc, then exec it. @@ -56,10 +55,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 +101,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);