X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fscan.c;h=705ff69b6a1d072dc9fbb9250bef3bd806fc5dec;hb=ac33b2e9c3632537b93fc4755a925c682d1eb82e;hp=56980e95b95a9dbd3cd7e0df3fa550714c7f8120;hpb=dee387b53ab0d42922f857b60d6f980c9e79d16f;p=mmh diff --git a/uip/scan.c b/uip/scan.c index 56980e9..705ff69 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -3,6 +3,10 @@ * 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 @@ -10,6 +14,7 @@ #include #include #include +#include #include /* @@ -47,7 +52,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; /* * global for sbr/formatsbr.c - yech! @@ -93,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 @@ -174,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; } @@ -316,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: