X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmark.c;h=03337229c679ed6360ba3990ed8ca209c6373f75;hp=2bbba6d82f09eb8e4c3904359c29e9613e597af9;hb=008837e090c008e3afe7a9c8667070bafa091e62;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/uip/mark.c b/uip/mark.c index 2bbba6d..0333722 100644 --- a/uip/mark.c +++ b/uip/mark.c @@ -5,9 +5,14 @@ * -- list sequences in given folder * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include +#include /* * We allocate space for messages (msgs array) @@ -36,7 +41,7 @@ static struct swit switches[] = { #define VERSIONSW 8 { "version", 0 }, #define HELPSW 9 - { "help", 4 }, + { "help", 0 }, #define DEBUGSW 10 { "debug", -5 }, { NULL, 0 } @@ -77,8 +82,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 @@ -155,9 +159,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; } @@ -249,7 +252,7 @@ main (int argc, char **argv) context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ - done (0); + return done (0); }