]> diplodocus.org Git - nmh/commitdiff
uip/scansbr.c: Replace uses of SBUFSIZ with NMH_BUFSIZ.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 7 May 2017 13:01:48 +0000 (14:01 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 7 May 2017 13:01:48 +0000 (14:01 +0100)
Now that the former is defined as the latter, the uses of SBUFSIZ were
all in the same expression and it simplifies from a ternary expression
to NMH_BUFSIZ.

uip/scansbr.c

index c7979b649748897ca69b766a7a0a2923809978ea..715357bc85fe0ed9d80885eb392980601c8ed0c4 100644 (file)
 #include <h/tws.h>
 #include <h/utils.h>
 
 #include <h/tws.h>
 #include <h/utils.h>
 
-/*
- * Buffer size for content part of header fields.  We want this
- * to be large enough so that we don't do a lot of extra FLDPLUS
- * calls on m_getfld but small enough so that we don't snarf
- * the entire message body when we're only going to display 30
- * characters of it.
- */
-#define SBUFSIZ NMH_BUFSIZ
-
 static struct format *fmt;
 static struct comp *datecomp;          /* pntr to "date" comp             */
 static struct comp *bodycomp;          /* pntr to "body" pseudo-comp      *
 static struct format *fmt;
 static struct comp *datecomp;          /* pntr to "date" comp             */
 static struct comp *bodycomp;          /* pntr to "body" pseudo-comp      *
@@ -122,9 +113,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
        nxtbuf = compbuffers = mh_xcalloc(ncomps, sizeof *nxtbuf);
        used_buf = mh_xcalloc(ncomps + 1, sizeof *used_buf);
        used_buf += ncomps+1; *--used_buf = 0;
        nxtbuf = compbuffers = mh_xcalloc(ncomps, sizeof *nxtbuf);
        used_buf = mh_xcalloc(ncomps + 1, sizeof *used_buf);
        used_buf += ncomps+1; *--used_buf = 0;
-       rlwidth = bodycomp && (width > SBUFSIZ)
-           ? min (width, NMH_BUFSIZ)
-           : SBUFSIZ;
+       rlwidth = NMH_BUFSIZ;
        for (i = ncomps; i--; )
            *nxtbuf++ = mh_xmalloc(rlwidth);
     }
        for (i = ncomps; i--; )
            *nxtbuf++ = mh_xmalloc(rlwidth);
     }