struct to go with it that do almost exactly what the code they've replaced
was doing.
Replaced this (duplicated) code in many files with a call to app_msgarg().
16 files changed:
char *add(char *, char *);
void create_folder(char *, int, void (*)());
int num_digits(int);
char *add(char *, char *);
void create_folder(char *, int, void (*)());
int num_digits(int);
+
+struct msgs_array {
+ int max, size;
+ char **msgs;
+};
+
+void app_msgarg(struct msgs_array *, char *);
+ * We allocate space for messages (msgs array)
+ * this number of elements at a time.
+ */
+#define MAXMSGS 256
+
+/*
* Safely call malloc
*/
void *
* Safely call malloc
*/
void *
+
+/*
+ * Append a message arg to an array of them, resizing it if necessary.
+ * The function is written to suit the arg parsing code it was extracted
+ * from, and will probably be changed when the other code is cleaned up.
+ */
+void
+app_msgarg(struct msgs_array *msgs, char *cp)
+{
+ if(msgs->size >= msgs->max)
+ msgs->msgs = mh_xrealloc(msgs->msgs, (msgs->max+=MAXMSGS)*sizeof(*msgs->msgs));
+ msgs->msgs[msgs->size++] = cp;
+}
#include <h/mh.h>
#include <h/utils.h>
#include <h/mh.h>
#include <h/utils.h>
-/*
- * We allocate space for messages (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define COMPSW 0
{ "component field", 0 },
static struct swit switches[] = {
#define COMPSW 0
{ "component field", 0 },
main (int argc, char **argv)
{
int inplace = 1, datesw = 1;
main (int argc, char **argv)
{
int inplace = 1, datesw = 1;
- int nummsgs, maxmsgs, msgnum;
char *cp, *maildir, *comp = NULL;
char *text = NULL, *folder = NULL, buf[BUFSIZ];
char *cp, *maildir, *comp = NULL;
char *text = NULL, *folder = NULL, buf[BUFSIZ];
- char **argp, **arguments, **msgs;
+ char **argp, **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
int append = 0; /* append annotations instead of default prepend */
int delete = -2; /* delete header element if set */
struct msgs *mp;
int append = 0; /* append annotations instead of default prepend */
int delete = -2; /* delete header element if set */
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
- /*
- * Allocate the initial space to record message
- * names and ranges.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
while ((cp = *argp++)) {
if (*cp == '-') {
switch (smatch (++cp, switches)) {
while ((cp = *argp++)) {
if (*cp == '-') {
switch (smatch (++cp, switches)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message name/ranges.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
*/
if (draft != (char *)0) {
*/
if (draft != (char *)0) {
adios(NULL, "can only have message numbers or -draft.");
draft = getcpy(m_draft(folder, (char *)0, 1, &isdf));
adios(NULL, "can only have message numbers or -draft.");
draft = getcpy(m_draft(folder, (char *)0, 1, &isdf));
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
make_comp (&comp);
done (1);
make_comp (&comp);
#include <h/mh.h>
#include <h/utils.h>
#include <h/mh.h>
#include <h/utils.h>
-/*
- * We allocate space for messages (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define ADDSW 0
{ "add", 0 },
static struct swit switches[] = {
#define ADDSW 0
{ "add", 0 },
{
int addsw = 0, deletesw = 0, debugsw = 0;
int listsw = 0, publicsw = -1, zerosw = 0;
{
int addsw = 0, deletesw = 0, debugsw = 0;
int listsw = 0, publicsw = -1, zerosw = 0;
- int seqp = 0, msgnum, nummsgs, maxmsgs;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
- char *seqs[NUMATTRS + 1], **msgs;
+ char *seqs[NUMATTRS + 1];
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
#ifdef LOCALE
struct msgs *mp;
#ifdef LOCALE
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
- if (!nummsgs)
- msgs[nummsgs++] = listsw ? "all" :"cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, listsw ? "all" :"cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
if (publicsw == 1 && is_readonly(mp))
done (1);
if (publicsw == 1 && is_readonly(mp))
# include <sys/wait.h>
#endif
# include <sys/wait.h>
#endif
-/*
- * We allocate space for message names (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
main (int argc, char **argv)
{
int sizesw = 1, headsw = 1;
main (int argc, char **argv)
{
int sizesw = 1, headsw = 1;
- int nummsgs, maxmsgs, msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
- char **arguments, **msgs;
+ char **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp = NULL;
CT ct, *ctp;
struct msgs *mp = NULL;
CT ct, *ctp;
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
/* null terminate the list of acceptable parts/types */
}
/* null terminate the list of acceptable parts/types */
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
adios (NULL, "cannot specify msg and file at same time!");
/*
adios (NULL, "cannot specify msg and file at same time!");
/*
/*
* message(s) are coming from a folder
*/
/*
* message(s) are coming from a folder
*/
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
# include <sys/wait.h>
#endif
# include <sys/wait.h>
#endif
-/*
- * We allocate space for message names (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define AUTOSW 0
{ "auto", 0 },
static struct swit switches[] = {
#define AUTOSW 0
{ "auto", 0 },
main (int argc, char **argv)
{
int sizesw = 1, headsw = 1;
main (int argc, char **argv)
{
int sizesw = 1, headsw = 1;
- int nummsgs, maxmsgs, msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
- char **arguments, **msgs;
+ char **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp = NULL;
CT ct, *ctp;
FILE *fp;
struct msgs *mp = NULL;
CT ct, *ctp;
FILE *fp;
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
/* null terminate the list of acceptable parts/types */
}
/* null terminate the list of acceptable parts/types */
if (showsw || storesw || cachesw)
adios (NULL, "cannot use -build with -show, -store, -cache");
if (showsw || storesw || cachesw)
adios (NULL, "cannot use -build with -show, -store, -cache");
adios (NULL, "need to specify a %s composition file", invo_name);
adios (NULL, "need to specify a %s composition file", invo_name);
adios (NULL, "only one %s composition file at a time", invo_name);
vecp = 0;
adios (NULL, "only one %s composition file at a time", invo_name);
vecp = 0;
else if (rfc934sw == -1)
vec[vecp++] = "-norfc934mode";
else if (rfc934sw == -1)
vec[vecp++] = "-norfc934mode";
+ vec[vecp++] = msgs.msgs[0];
vec[vecp] = NULL;
execvp ("mhbuild", vec);
vec[vecp] = NULL;
execvp ("mhbuild", vec);
/*
* Process a mhn composition file (old MH style)
*/
/*
* Process a mhn composition file (old MH style)
*/
- if (nummsgs == 1 && !folder && !npart && !cachesw
+ if (msgs.size == 1 && !folder && !npart && !cachesw
&& !showsw && !storesw && !ntype && !file
&& (cp = getenv ("mhdraft"))
&& !showsw && !storesw && !ntype && !file
&& (cp = getenv ("mhdraft"))
- && strcmp (cp, msgs[0]) == 0) {
+ && strcmp (cp, msgs.msgs[0]) == 0) {
char *vec[MAXARGS];
int vecp;
char *vec[MAXARGS];
int vecp;
adios (NULL, "cannot specify msg and file at same time!");
/*
adios (NULL, "cannot specify msg and file at same time!");
/*
/*
* message(s) are coming from a folder
*/
/*
* message(s) are coming from a folder
*/
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
-/*
- * Add space for message/sequence names
- * by MAXMSGS at a time.
- */
-#define MAXMSGS 256
-
-
int
main(int argc, char **argv)
{
int
main(int argc, char **argv)
{
- int i, maxmsgs, nummsgs;
char *cp, *maildir, *folder = NULL;
char *cp, *maildir, *folder = NULL;
char **arguments, buf[BUFSIZ];
char **arguments, buf[BUFSIZ];
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
#ifdef LOCALE
struct msgs *mp;
#ifdef LOCALE
- * Allocate initial space to record message
- * and sequence names
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * if necessary, reallocate space for
- * message/sequence names
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
if (!context_find ("path"))
}
if (!context_find ("path"))
maildir = m_maildir (folder);
/* If no messages are given, print folder pathname */
maildir = m_maildir (folder);
/* If no messages are given, print folder pathname */
printf ("%s\n", maildir);
done (0);
}
printf ("%s\n", maildir);
done (0);
}
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
/* parse all the message ranges/sequences and set SELECTED */
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
/* parse all the message ranges/sequences and set SELECTED */
- for (i = 0; i < nummsgs; i++)
- if (!m_convert (mp, msgs[i]))
+ for (i = 0; i < msgs.size; i++)
+ if (!m_convert (mp, msgs.msgs[i]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
# include <sys/wait.h>
#endif
# include <sys/wait.h>
#endif
-/*
- * We allocate space for message names (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nummsgs, maxmsgs, msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
- char **arguments, **msgs;
+ char **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp = NULL;
CT ct, *ctp;
FILE *fp;
struct msgs *mp = NULL;
CT ct, *ctp;
FILE *fp;
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
/* null terminate the list of acceptable parts/types */
}
/* null terminate the list of acceptable parts/types */
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
adios (NULL, "cannot specify msg and file at same time!");
/*
adios (NULL, "cannot specify msg and file at same time!");
/*
/*
* message(s) are coming from a folder
*/
/*
* message(s) are coming from a folder
*/
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
# include <sys/wait.h>
#endif
# include <sys/wait.h>
#endif
-/*
- * We allocate space for message names (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define AUTOSW 0
{ "auto", 0 },
static struct swit switches[] = {
#define AUTOSW 0
{ "auto", 0 },
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nummsgs, maxmsgs, msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
- char **arguments, **msgs;
+ char **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp = NULL;
CT ct, *ctp;
FILE *fp;
struct msgs *mp = NULL;
CT ct, *ctp;
FILE *fp;
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
/* null terminate the list of acceptable parts/types */
}
/* null terminate the list of acceptable parts/types */
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
adios (NULL, "cannot specify msg and file at same time!");
/*
adios (NULL, "cannot specify msg and file at same time!");
/*
/*
* message(s) are coming from a folder
*/
/*
* message(s) are coming from a folder
*/
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
# include <sys/wait.h>
#endif
# include <sys/wait.h>
#endif
-/*
- * We allocate space for message names (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
static struct swit switches[] = {
#define CHECKSW 0
{ "check", 0 },
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nummsgs, maxmsgs, msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], *outfile = NULL;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], *outfile = NULL;
- char **argp, **arguments, **msgs;
+ char **argp, **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp = NULL;
CT ct, *ctp;
struct msgs *mp = NULL;
CT ct, *ctp;
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
/* null terminate the list of acceptable parts/types */
}
/* null terminate the list of acceptable parts/types */
if (!context_find ("path"))
free (path ("./", TFOLDER));
if (!context_find ("path"))
free (path ("./", TFOLDER));
adios (NULL, "cannot specify msg and file at same time!");
/*
adios (NULL, "cannot specify msg and file at same time!");
/*
/*
* message(s) are coming from a folder
*/
/*
* message(s) are coming from a folder
*/
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
#include <h/utils.h>
#include <errno.h>
#include <h/utils.h>
#include <errno.h>
-/*
- * We allocate space for messages (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define FILESW 0
{ "file name", 0 },
static struct swit switches[] = {
#define FILESW 0
{ "file name", 0 },
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nummsgs, maxmsgs, fd, msgnum;
char *cp, *maildir, *msgnam, *folder = NULL, buf[BUFSIZ];
char *cp, *maildir, *msgnam, *folder = NULL, buf[BUFSIZ];
- char **argp, **arguments, **msgs;
+ char **argp, **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
struct stat st;
struct msgs *mp;
struct stat st;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
- /* Allocate the initial space to record message
- * names and ranges.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
if (folder)
adios (NULL, "only one folder at a time!");
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
if (folder)
adios (NULL, "only one folder at a time!");
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message name/ranges.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
free (path ("./", TFOLDER));
/* default is to pack whole folder */
free (path ("./", TFOLDER));
/* default is to pack whole folder */
- if (!nummsgs)
- msgs[nummsgs++] = "all";
+ if (!msgs.size)
+ app_msgarg(&msgs, "all");
if (!folder)
folder = getfolder (1);
if (!folder)
folder = getfolder (1);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
#include <h/picksbr.h>
#include <h/utils.h>
#include <h/picksbr.h>
#include <h/utils.h>
-/*
- * We allocate space for messages (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define ANDSW 0
{ "and", 0 },
static struct swit switches[] = {
#define ANDSW 0
{ "and", 0 },
main (int argc, char **argv)
{
int publicsw = -1, zerosw = 1, seqp = 0, vecp = 0;
main (int argc, char **argv)
{
int publicsw = -1, zerosw = 1, seqp = 0, vecp = 0;
- int nummsgs, maxmsgs, lo, hi, msgnum;
char *maildir, *folder = NULL, buf[100];
char *cp, **argp, **arguments;
char *maildir, *folder = NULL, buf[100];
char *cp, **argp, **arguments;
- char **msgs, *seqs[NUMATTRS + 1], *vec[MAXARGS];
+ char *seqs[NUMATTRS + 1], *vec[MAXARGS];
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
register FILE *fp;
struct msgs *mp;
register FILE *fp;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
- /*
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
while ((cp = *argp++)) {
if (*cp == '-') {
if (*++cp == '-') {
while ((cp = *argp++)) {
if (*cp == '-') {
if (*++cp == '-') {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message name/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
* If we didn't specify which messages to search,
* then search the whole folder.
*/
* If we didn't specify which messages to search,
* then search the whole folder.
*/
- if (!nummsgs)
- msgs[nummsgs++] = "all";
+ if (!msgs.size)
+ app_msgarg(&msgs, "all");
if (!folder)
folder = getfolder (1);
if (!folder)
folder = getfolder (1);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
#include <fcntl.h>
#include <errno.h>
#include <fcntl.h>
#include <errno.h>
-/*
- * We allocate spaces for messages (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define DRAFTSW 0
{ "draft", 0 },
static struct swit switches[] = {
#define DRAFTSW 0
{ "draft", 0 },
{
int linkf = 0, preserve = 0, filep = 0;
int foldp = 0, isdf = 0, unlink_msgs = 0;
{
int linkf = 0, preserve = 0, filep = 0;
int foldp = 0, isdf = 0, unlink_msgs = 0;
- int i, msgnum, nummsgs, maxmsgs;
char *cp, *folder = NULL, buf[BUFSIZ];
char *cp, *folder = NULL, buf[BUFSIZ];
- char **argp, **arguments, **msgs;
+ char **argp, **arguments;
char *filevec[NFOLDERS + 2];
char **files = &filevec[1]; /* leave room for remove_files:vec[0] */
struct st_fold folders[NFOLDERS + 1];
char *filevec[NFOLDERS + 2];
char **files = &filevec[1]; /* leave room for remove_files:vec[0] */
struct st_fold folders[NFOLDERS + 1];
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
#ifdef LOCALE
struct msgs *mp;
#ifdef LOCALE
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only %d folders allowed!", NFOLDERS);
folders[foldp++].f_name =
path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only %d folders allowed!", NFOLDERS);
folders[foldp++].f_name =
path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names, ranges, and sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
if (!context_find ("path"))
}
if (!context_find ("path"))
adios (NULL, "no folder specified");
#ifdef WHATNOW
adios (NULL, "no folder specified");
#ifdef WHATNOW
- if (!nummsgs && !foldp && !filep && (cp = getenv ("mhdraft")) && *cp)
+ if (!msgs.size && !foldp && !filep && (cp = getenv ("mhdraft")) && *cp)
files[filep++] = cp;
#endif /* WHATNOW */
files[filep++] = cp;
#endif /* WHATNOW */
* We are refiling a file to the folders
*/
if (filep > 0) {
* We are refiling a file to the folders
*/
if (filep > 0) {
+ if (folder || msgs.size)
adios (NULL, "use -file or some messages, not both");
opnfolds (folders, foldp);
for (i = 0; i < filep; i++)
adios (NULL, "use -file or some messages, not both");
opnfolds (folders, foldp);
for (i = 0; i < filep; i++)
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
strncpy (maildir, m_maildir (folder), sizeof(maildir));
if (!folder)
folder = getfolder (1);
strncpy (maildir, m_maildir (folder), sizeof(maildir));
adios (NULL, "no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse the message range/sequence/name and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
#include <h/mh.h>
#include <h/utils.h>
#include <h/mh.h>
#include <h/utils.h>
-/*
- * We allocate space for message names and ranges
- * (msgs array) this number of elements at a time.
- */
-#define MAXMSGS 256
-
static struct swit switches[] = {
#define UNLINKSW 0
{ "unlink", 0 },
static struct swit switches[] = {
#define UNLINKSW 0
{ "unlink", 0 },
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nummsgs, maxmsgs, msgnum, unlink_msgs = 0;
+ int msgnum, unlink_msgs = 0;
char *cp, *maildir, *folder = NULL;
char buf[BUFSIZ], **argp;
char *cp, *maildir, *folder = NULL;
char buf[BUFSIZ], **argp;
- char **arguments, **msgs;
+ char **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
#ifdef LOCALE
struct msgs *mp;
#ifdef LOCALE
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments (invo_name, argc, argv, 1);
argp = arguments;
- /*
- * Allocate the initial space to record message
- * names and ranges.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
/* parse arguments */
while ((cp = *argp++)) {
if (*cp == '-') {
/* parse arguments */
while ((cp = *argp++)) {
if (*cp == '-') {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges.
- */
- if (nummsgs >= maxmsgs){
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
- if (!nummsgs)
- msgs[nummsgs++] = "cur";
+ if (!msgs.size)
+ app_msgarg(&msgs, "cur");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous-sequence */
done (1);
seq_setprev (mp); /* set the previous-sequence */
#include <h/utils.h>
#include <errno.h>
#include <h/utils.h>
#include <errno.h>
-/*
- * We allocate space for message names (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define CLRSW 0
{ "clear", 0 },
static struct swit switches[] = {
#define CLRSW 0
{ "clear", 0 },
{
int clearflag = 0, hdrflag = 0, ontty;
int width = 0, revflag = 0;
{
int clearflag = 0, hdrflag = 0, ontty;
int width = 0, revflag = 0;
- int i, state, msgnum, nummsgs, maxmsgs;
int seqnum[NUMATTRS], unseen, num_unseen_seq = 0;
char *cp, *maildir, *file = NULL, *folder = NULL;
char *form = NULL, *format = NULL, buf[BUFSIZ];
int seqnum[NUMATTRS], unseen, num_unseen_seq = 0;
char *cp, *maildir, *file = NULL, *folder = NULL;
char *form = NULL, *format = NULL, buf[BUFSIZ];
- char **argp, *nfs, **arguments, **msgs;
+ char **argp, *nfs, **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
FILE *in;
struct msgs *mp;
FILE *in;
- * Allocate the initial space to record message
- * names, ranges, and sequences.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges/sequences.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
if (!context_find ("path"))
}
if (!context_find ("path"))
* We are scanning a maildrop file
*/
if (file) {
* We are scanning a maildrop file
*/
if (file) {
adios (NULL, "\"msgs\" not allowed with -file");
if (folder)
adios (NULL, "\"+folder\" not allowed with -file");
adios (NULL, "\"msgs\" not allowed with -file");
if (folder)
adios (NULL, "\"+folder\" not allowed with -file");
* We are scanning a folder
*/
* We are scanning a folder
*/
- if (!nummsgs)
- msgs[nummsgs++] = "all";
+ if (!msgs.size)
+ app_msgarg(&msgs, "all");
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
if (!folder)
folder = getfolder (1);
maildir = m_maildir (folder);
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done(1);
seq_setprev (mp); /* set the Previous-Sequence */
done(1);
seq_setprev (mp); /* set the Previous-Sequence */
#include <h/tws.h>
#include <h/utils.h>
#include <h/tws.h>
#include <h/utils.h>
-/*
- * We allocate space for messages (msgs array)
- * this number of elements at a time.
- */
-#define MAXMSGS 256
-
-
static struct swit switches[] = {
#define DATESW 0
{ "datefield field", 0 },
static struct swit switches[] = {
#define DATESW 0
{ "datefield field", 0 },
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
- int nummsgs, maxmsgs, i, msgnum;
char *cp, *maildir, *datesw = NULL;
char *folder = NULL, buf[BUFSIZ], **argp;
char *cp, *maildir, *datesw = NULL;
char *folder = NULL, buf[BUFSIZ], **argp;
- char **arguments, **msgs;
+ char **arguments;
+ struct msgs_array msgs = { 0, 0, NULL };
struct msgs *mp;
struct smsg **dlist;
struct msgs *mp;
struct smsg **dlist;
- * Allocate the initial space to record message
- * names and ranges.
- */
- nummsgs = 0;
- maxmsgs = MAXMSGS;
- msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs)));
-
- /*
* Parse arguments
*/
while ((cp = *argp++)) {
* Parse arguments
*/
while ((cp = *argp++)) {
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
adios (NULL, "only one folder at a time!");
else
folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
- } else {
- /*
- * Check if we need to allocate more space
- * for message names/ranges.
- */
- if (nummsgs >= maxmsgs) {
- maxmsgs += MAXMSGS;
- msgs = (char **) mh_xrealloc (msgs,
- (size_t) (maxmsgs * sizeof(*msgs)));
- }
- msgs[nummsgs++] = cp;
- }
+ } else
+ app_msgarg(&msgs, cp);
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
}
if (!context_find ("path"))
free (path ("./", TFOLDER));
- if (!nummsgs)
- msgs[nummsgs++] = "all";
+ if (!msgs.size)
+ app_msgarg(&msgs, "all");
if (!datesw)
datesw = "date";
if (!folder)
if (!datesw)
datesw = "date";
if (!folder)
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
adios (NULL, "no messages in %s", folder);
/* parse all the message ranges/sequences and set SELECTED */
- for (msgnum = 0; msgnum < nummsgs; msgnum++)
- if (!m_convert (mp, msgs[msgnum]))
+ for (msgnum = 0; msgnum < msgs.size; msgnum++)
+ if (!m_convert (mp, msgs.msgs[msgnum]))
done (1);
seq_setprev (mp); /* set the previous sequence */
done (1);
seq_setprev (mp); /* set the previous sequence */