X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fscan.c;h=705ff69b6a1d072dc9fbb9250bef3bd806fc5dec;hp=cbd92773fe2d6f6452c69e6aa53574698669fe62;hb=389877bae1fe1a9f7259b8979f6a930744d90fab;hpb=3c9700d8d045f3ff26ce5dd2a174454dafc14822 diff --git a/uip/scan.c b/uip/scan.c index cbd9277..705ff69 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -3,12 +3,18 @@ * scan.c -- display a one-line "scan" listing of folder or messages * * $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 #include -#include +#include +#include +#include #include /* @@ -42,11 +48,10 @@ static struct swit switches[] = { #define VERSIONSW 10 { "version", 0 }, #define HELPSW 11 - { "help", 4 }, + { "help", 0 }, { NULL, 0 } }; -extern int errno; /* * global for sbr/formatsbr.c - yech! @@ -92,8 +97,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 @@ -173,9 +177,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; } @@ -315,7 +318,7 @@ main (int argc, char **argv) switch (state = scan (in, msgnum, 0, nfs, width, msgnum == mp->curmsg, unseen, - hdrflag ? folder : NULL, 0L, 1)) { + folder, 0L, 1)) { case SCNMSG: case SCNENC: case SCNERR: