X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/148b4c486ec273fd1cfc70e2b099d8edc25ed8f3..4829d096feb337a55e2b866adb19acab9617b071:/uip/burst.c diff --git a/uip/burst.c b/uip/burst.c index 4de5f042..b80d9ce9 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -6,6 +6,10 @@ */ #include "h/mh.h" +#include "sbr/m_name.h" +#include "sbr/m_gmprot.h" +#include "sbr/getarguments.h" +#include "sbr/seq_setprev.h" #include "sbr/seq_setcur.h" #include "sbr/seq_save.h" #include "sbr/smatch.h" @@ -128,13 +132,13 @@ main (int argc, char **argv) continue; case MIMESW: - mimesw = 2; + mimesw = 2; continue; case NMIMESW: - mimesw = 0; + mimesw = 0; continue; case AUTOMIMESW: - mimesw = 1; + mimesw = 1; continue; case QIETSW: @@ -261,7 +265,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw) */ if (*mimesw > 0) { - content = parse_mime(msgnam); + content = parse_mime(msgnam); if (! content && *mimesw == 2) return 0; if (content) { @@ -271,9 +275,9 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw) find_mime_parts(content, smsgs, &msgp); free_content(content); if (msgp == 1 && *mimesw == 2) - adios (msgnam, "does not have any message/rfc822 parts"); + adios (msgnam, "does not have any message/rfc822 parts"); if (msgp > 1) { - *mimesw = 1; + *mimesw = 1; return msgp - 1; } } @@ -285,7 +289,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw) adios (msgnam, "unable to read message"); for (msgp = 0, pos = 0L; msgp <= MAXFOLDER;) { - /* + /* * We're either at the beginning of the whole message, or * we're just past the delimiter of the last message. * Swallow lines until we get to something that's not a newline @@ -357,7 +361,7 @@ find_mime_parts (CT content, struct smsg *smsgs, int *msgp) */ if (content->c_type == CT_MESSAGE && - content->c_subtype == MESSAGE_RFC822) { + content->c_subtype == MESSAGE_RFC822) { smsgs[*msgp].s_start = content->c_begin; smsgs[*msgp].s_stop = content->c_end; (*msgp)++; @@ -369,7 +373,7 @@ find_mime_parts (CT content, struct smsg *smsgs, int *msgp) */ if (content->c_type == CT_MULTIPART) { - m = (struct multipart *) content->c_ctparams; + m = (struct multipart *) content->c_ctparams; for (part = m->mp_parts; part; part = part->mp_next) find_mime_parts(part->mp_part, smsgs, msgp); @@ -430,8 +434,8 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst, */ if (inplace) { for (i = mp->hghmsg; j > msgnum; i--, j--) { - strncpy (f1, m_name (i), sizeof(f1)); - strncpy (f2, m_name (j), sizeof(f2)); + strncpy (f1, m_name (i), sizeof(f1) - 1); + strncpy (f2, m_name (j), sizeof(f2) - 1); if (does_exist (mp, j)) { if (verbosw) printf ("message %d becomes message %d\n", j, i); @@ -479,8 +483,8 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst, die("unable to create temporary file in %s", get_temp_dir()); } - strncpy (f2, tempfile, sizeof(f2)); - strncpy (f1, m_name (i), sizeof(f1)); + strncpy (f2, tempfile, sizeof(f2) - 1); + strncpy (f1, m_name (i), sizeof(f1) - 1); if (verbosw && i != msgnum) printf ("message %d of digest %d becomes message %d\n", j, msgnum, i); @@ -492,7 +496,7 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst, fclose (out); if (i == msgnum) { - strncpy (f3, m_backup (f1), sizeof(f3)); + strncpy (f3, m_backup (f1), sizeof(f3) - 1); if (rename (f1, f3) == NOTOK) admonish (f3, "unable to rename %s to", f1); @@ -573,7 +577,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime) break; case S4: - fputc (c, out); + fputc (c, out); break; } }