X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/21684f3b83eb0b29e6ead6f60955826de379541a..4ac978448:/sbr/folder_delmsgs.c?ds=inline diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index ee4bd9e9..94aa29ce 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -8,6 +8,7 @@ */ #include +#include /* * 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,14 +103,14 @@ 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); if (unlink_msgs) { /* just unlink the messages */ - if (unlink (dp) == -1) { + if (m_unlink (dp) == -1) { admonish (dp, "unable to unlink"); retval = -1; continue;