X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Frefile.c;h=e50253af5f5ebffba89ba603974a02cb4345ae83;hb=3465392f2ac1ac472d44c10c3c989389421c82b2;hp=c184dc1f09cffab92cbd037d16f3c214fc6a6567;hpb=4885712264980e6cbc2039f9158027bee9213475;p=mmh diff --git a/uip/refile.c b/uip/refile.c index c184dc1..e50253a 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -11,6 +11,7 @@ */ #include +#include #include #include @@ -97,8 +98,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 @@ -185,9 +185,8 @@ main (int argc, char **argv) */ if (nummsgs >= maxmsgs) { maxmsgs += MAXMSGS; - if (!(msgs = (char **) realloc (msgs, - (size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to reallocate msgs storage"); + msgs = (char **) mh_xrealloc (msgs, + (size_t) (maxmsgs * sizeof(*msgs))); } msgs[nummsgs++] = cp; } @@ -400,7 +399,7 @@ m_file (char *msgfile, struct st_fold *folders, int nfolders, int preserve, int struct st_fold *fp, *ep; for (fp = folders, ep = folders + nfolders; fp < ep; fp++) { - if ((msgnum = folder_addmsg (&fp->f_mp, msgfile, 1, 0, preserve, nfolders == 1 && refile)) == -1) + if ((msgnum = folder_addmsg (&fp->f_mp, msgfile, 1, 0, preserve, nfolders == 1 && refile, maildir)) == -1) return 1; } return 0;