From: David Levine Date: Sun, 27 Aug 2017 13:25:21 +0000 (-0400) Subject: Ensure that mhfixmsg exit status is either 0 or 1. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/152af2f5d075ce062e9a578738ad5c32735dd682 Ensure that mhfixmsg exit status is either 0 or 1. Ralph noticed where exit status values were being accumulated, and those values could include -1. --- diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 34e366ce..fc1b0a6d 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -485,7 +485,10 @@ main (int argc, char **argv) { if (*cts) { for (ctp = cts; *ctp; ++ctp) { - status += mhfixmsgsbr (ctp, maildir, &fx, &infp, outfile, &outfp); + status = + mhfixmsgsbr (ctp, maildir, &fx, &infp, outfile, &outfp) == OK + ? 0 + : 1; free_content (*ctp); if (using_stdin) { @@ -512,7 +515,7 @@ main (int argc, char **argv) { free (folder); free (arguments); - done (status); + done (status == OK ? 0 : 1); return NOTOK; } @@ -2716,7 +2719,7 @@ write_content (CT ct, const char *input_filename, char *outfile, FILE *outfp, } } else { inform("unable to remove input file %s, " - "not modifying it, continuing...", infile); + "not modifying it, continuing...", infile); (void) m_unlink (outfile); status = NOTOK; }