X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Frmm.c;h=b9fd80dcfa9bec7f77251b0038e04bfbdc1f745f;hb=ac33b2e9c3632537b93fc4755a925c682d1eb82e;hp=a18c278ef2d40c0860976f3e3e6041e9483023da;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/uip/rmm.c b/uip/rmm.c index a18c278..b9fd80d 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -10,6 +10,7 @@ */ #include +#include /* * We allocate space for message names and ranges @@ -56,8 +57,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 */ while ((cp = *argp++)) { @@ -98,9 +98,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; } @@ -145,7 +144,7 @@ main (int argc, char **argv) } /* "remove" the SELECTED messages */ - folder_delmsgs (mp, unlink_msgs); + folder_delmsgs (mp, unlink_msgs, 0); seq_save (mp); /* synchronize message sequences */ context_replace (pfolder, folder); /* update current folder */