Commit 49bd25f7 49bd25f7ebb26f827de92f8eb441fe1d176d8353 by Sergey Poznyakoff

Updated calls to mh_format

1 parent db579602
......@@ -129,17 +129,17 @@ opt_handler (int key, char *arg, void *unused)
}
void
list_message (mh_format_t *format, mailbox_t mbox, size_t msgno,
char *buffer, size_t width)
list_message (mh_format_t *format, mailbox_t mbox, size_t msgno, size_t width)
{
message_t msg;
char *buf = NULL;
buffer[0] = 0;
mailbox_get_message (mbox, msgno, &msg);
mh_format (format, msg, msgno, buffer, width);
printf ("%s\n", buffer);
mh_format (format, msg, msgno, width, &buf);
printf ("%s\n", buf);
if (audit_fp)
fprintf (audit_fp, "%s\n", buffer);
fprintf (audit_fp, "%s\n", buf);
free (buf);
}
int
......@@ -151,7 +151,6 @@ main (int argc, char **argv)
size_t lastmsg;
int f_truncate = 0;
int f_changecur = 0;
char *buffer;
mh_format_t format;
int rc;
......@@ -210,8 +209,6 @@ main (int argc, char **argv)
exit (1);
}
buffer = xmalloc (width);
/* Fixup options */
if (truncate_source == -1)
truncate_source = f_truncate;
......@@ -249,7 +246,7 @@ main (int argc, char **argv)
}
if (!quiet)
list_message (&format, output, lastmsg + n, buffer, width);
list_message (&format, output, lastmsg + n, width);
if (truncate_source)
{
......
......@@ -71,8 +71,6 @@ static mh_format_t format;
static mh_msgset_t msgset;
static char *buffer;
void list_message __P((mailbox_t mbox, message_t msg, size_t num, void *data));
void print_header __P((mailbox_t mbox));
void clear_screen __P((void));
......@@ -171,8 +169,6 @@ main (int argc, char **argv)
mbox = mh_open_folder (current_folder, 0);
buffer = xmalloc (width);
argc -= index;
argv += index;
if ((argc == 0 || strcmp (argv[0], "all") == 0) && !reverse)
......@@ -268,7 +264,8 @@ clear_screen ()
void
list_message (mailbox_t mbox, message_t msg, size_t num, void *data)
{
buffer[0] = 0;
mh_format (&format, msg, num, buffer, width);
char *buffer;
mh_format (&format, msg, num, width, &buffer);
printf ("%s\n", buffer);
free (buffer);
}
......