]> diplodocus.org Git - nmh/blobdiff - uip/burst.c
Alter mh-chart(7)'s NAME to be lowercase.
[nmh] / uip / burst.c
index ff5af237c60f2adba797d03b5b6d215a6343d622..ab2a9e5d8796bd0d29e7533a3a720b5cd13591ec 100644 (file)
@@ -42,7 +42,6 @@ struct smsg {
  */
 
 int debugsw = 0;
-pid_t xpid = 0;
 
 /*
  * static prototypes
@@ -165,10 +164,7 @@ main (int argc, char **argv)
            done (1);
     seq_setprev (mp);  /* set the previous-sequence */
 
-    smsgs = (struct smsg *)
-       calloc ((size_t) (MAXFOLDER + 2), sizeof(*smsgs));
-    if (smsgs == NULL)
-       adios (NULL, "unable to allocate burst storage");
+    smsgs = mh_xcalloc(MAXFOLDER + 2, sizeof *smsgs);
 
     hi = mp->hghmsg + 1;
 
@@ -193,7 +189,7 @@ main (int argc, char **argv)
        }
     }
 
-    free ((char *) smsgs);
+    free(smsgs);
     context_replace (pfolder, folder); /* update current folder */
 
     /*
@@ -246,7 +242,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
        content = parse_mime(msgnam);
        if (! content && *mimesw == 2)
            return 0;
-       else if (content) {
+       if (content) {
            smsgs[0].s_start = 0;
            smsgs[0].s_stop = content->c_begin - 1;
            msgp = 1;
@@ -288,7 +284,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
        /*
         * Read in lines until we get to a message delimiter.
         *
-        * Previously we checked to make sure the preceeding line and
+        * Previously we checked to make sure the preceding line and
         * next line was a newline.  That actually does not comply with
         * RFC 934, so make sure we break on a message delimiter even
         * if the previous character was NOT a newline.
@@ -482,13 +478,13 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst,
                admonish (f3, "unable to rename %s to", f1);
 
            (void)snprintf(f3, sizeof (f3), "%s/%d", maildir, i);
-           ext_hook("del-hook", f3, (char *)0);
+           ext_hook("del-hook", f3, NULL);
        }
        if (rename (f2, f1) == NOTOK)
            admonish (f1, "unable to rename %s to", f2);
 
        (void)snprintf(f3, sizeof (f3), "%s/%d", maildir, i);
-       ext_hook("add-hook", f3, (char *)0);
+       ext_hook("add-hook", f3, NULL);
 
        copy_msg_flags (mp, i, msgnum);
        mp->msgflags |= SEQMOD;
@@ -504,14 +500,14 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst,
 #define S4  3
 
 /*
- * Copy a mesage which is being burst out of a digest.
+ * Copy a message which is being burst out of a digest.
  * It will remove any "dashstuffing" in the message.
  */
 
 static void
 cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime)
 {
-    register int c, state;
+    int c, state;
 
     for (state = mime ? S4 : S1; (c = fgetc (in)) != EOF && len > 0; len--) {
        if (c == 0)
@@ -525,6 +521,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime)
 
                    default: 
                        state = S2;
+                       /* FALLTHRU */
                    case '\n': 
                        fputc (c, out);
                        break;
@@ -535,6 +532,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime)
                switch (c) {
                    case '\n': 
                        state = S1;
+                       /* FALLTHRU */
                    default: 
                        fputc (c, out);
                        break;