]> diplodocus.org Git - nmh/blobdiff - uip/rcvdist.c
sbr/mts.c: Make MMDF's delimeters fixed at compile time.
[nmh] / uip / rcvdist.c
index b255afa9bc860b4cbfd1b3ae78bd3e70b20658f3..1ad585d2035cdab965cb8f8329820f417a801f89 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * rcvdist.c -- asynchronously redistribute messages
+/* rcvdist.c -- asynchronously redistribute messages
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -13,6 +11,7 @@
 #include <h/tws.h>
 #include <h/mts.h>
 #include <h/utils.h>
+#include "../sbr/m_mktemp.h"
 
 #define RCVDIST_SWITCHES \
     X("form formfile", 4, FORMSW) \
@@ -146,8 +145,6 @@ main (int argc, char **argv)
 
 /* very similar to routine in replsbr.c */
 
-#define        SBUFSIZ 256
-
 static int outputlinelen = OUTPUTLINELEN;
 
 static struct format *fmt;
@@ -176,7 +173,7 @@ rcvdistout (FILE *inb, char *form, char *addrs)
 {
     int char_read = 0, format_len, i, state;
     char **ap;
-    char *cp, name[NAMESZ], tmpbuf[SBUFSIZ];
+    char *cp, name[NAMESZ], tmpbuf[NMH_BUFSIZ];
     charstring_t scanl;
     struct comp *cptr;
     FILE *out;
@@ -201,7 +198,7 @@ rcvdistout (FILE *inb, char *form, char *addrs)
        cptr->c_text = addrs;
 
     for (;;) {
-       int msg_count = SBUFSIZ;
+       int msg_count = sizeof tmpbuf;
        switch (state = m_getfld (&gstate, name, tmpbuf, &msg_count, inb)) {
            case FLD: 
            case FLDPLUS: 
@@ -209,7 +206,7 @@ rcvdistout (FILE *inb, char *form, char *addrs)
                if (i != -1) {
                    char_read += msg_count;
                    while (state == FLDPLUS) {
-                       msg_count = SBUFSIZ;
+                       msg_count = sizeof tmpbuf;
                        state = m_getfld (&gstate, name, tmpbuf, &msg_count, inb);
                        fmt_appendcomp(i, name, tmpbuf);
                        char_read += msg_count;
@@ -217,7 +214,7 @@ rcvdistout (FILE *inb, char *form, char *addrs)
                }
 
                while (state == FLDPLUS) {
-                   msg_count = SBUFSIZ;
+                   msg_count = sizeof tmpbuf;
                    state = m_getfld (&gstate, name, tmpbuf, &msg_count, inb);
                }
                break;
@@ -251,7 +248,7 @@ finished: ;
 }
 
 
-static void
+static void NORETURN
 unlink_done (int status)
 {
     if (backup[0])