* 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 <h/mh.h>
#include <h/fmt_scan.h>
#include <h/scansbr.h>
#include <h/tws.h>
-#include <mts/generic/mts.h>
+#include <h/mts.h>
+#include <h/utils.h>
#include <errno.h>
/*
{ NULL, 0 }
};
-extern int errno;
/*
* global for sbr/formatsbr.c - yech!
*/
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
*/
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;
}
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: