Function prototype

Use an enum type instead of a string to define the file opening mode.
This commit is contained in:
2024-09-19 22:40:20 +02:00
parent b30f2f2362
commit bd64536e89
4 changed files with 22 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
/*
mboxgrep - scan mailbox for messages matching a regular expression
Copyright (C) 2000 - 2004, 2006, 2023 Daniel Spiljar
Copyright (C) 2000 - 2004, 2006, 2023 - 2024 Daniel Spiljar
Mboxgrep is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
@@ -107,7 +107,7 @@ scan_mailbox (char path[])
if ((config.format == FORMAT_MBOX) || (config.format == FORMAT_ZMBOX)
|| (config.format == FORMAT_BZ2MBOX))
{
mbox = (mbox_t *) mbox_open (path, "r");
mbox = (mbox_t *) mbox_open (path, r);
if (mbox == NULL)
return;
}
@@ -179,7 +179,7 @@ scan_mailbox (char path[])
else if ((config.format == FORMAT_MBOX) || (config.format == FORMAT_ZMBOX)
|| (config.format == FORMAT_BZ2MBOX))
{
out = mbox_open (config.outboxname, "w");
out = mbox_open (config.outboxname, w);
/* fprintf (out->fp, "%s\n%s", msg->headers, msg->body); */
mbox_write_message (msg, out);
mbox_close (out);