]> diplodocus.org Git - nmh/commitdiff
Replaced BUFSIZ with NMH_BUFSIZ in a few places.
authorDavid Levine <levinedl@acm.org>
Mon, 31 Oct 2016 19:17:55 +0000 (15:17 -0400)
committerDavid Levine <levinedl@acm.org>
Mon, 31 Oct 2016 19:19:32 +0000 (15:19 -0400)
This allows the test suite to succeed with BUFSIZ of 256.  We should
consider using different constants for different purposes.

sbr/error.c
sbr/fmt_scan.c
uip/mhfixmsg.c

index d6d96851504420c9a8a3995075fc63f7fa016600..e4bc9e3f96c093f372263574baac2cdd3b715bb4 100644 (file)
@@ -69,7 +69,7 @@ void
 advertise (const char *what, char *tail, const char *fmt, va_list ap)
 {
     int        eindex = errno;
-    char buffer[BUFSIZ], errbuf[BUFSIZ], *err;
+    char buffer[NMH_BUFSIZ], errbuf[NMH_BUFSIZ], *err;
     struct iovec iob[10], *iov;
     size_t niov;
 
index a47c170e7c78cdabf5b0d51b1818230d38098033..1ea5e623fb6767875f7c7a52c5a073a7513060f3 100644 (file)
@@ -364,7 +364,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat,
 {
     char *sp;
     char *savestr, *str;
-    char buffer[BUFSIZ], buffer2[BUFSIZ];
+    char buffer[NMH_BUFSIZ], buffer2[NMH_BUFSIZ];
     int i, c, rjust;
     int value;
     time_t t;
index 388a1c6cda5daa098a8593671b9e4f3efb714e2b..086bac09ec811ca0aca16e674b2f7598948fd716 100644 (file)
@@ -676,7 +676,7 @@ fix_boundary (CT *ct, int *message_mods) {
  */
 static int
 get_multipart_boundary (CT ct, char **part_boundary) {
-    char buffer[BUFSIZ];
+    char buffer[NMH_BUFSIZ];
     char *end_boundary = NULL;
     off_t begin = (off_t) ct->c_end > (off_t) (ct->c_begin + sizeof buffer)
         ?  (off_t) (ct->c_end - sizeof buffer)
@@ -684,7 +684,7 @@ get_multipart_boundary (CT ct, char **part_boundary) {
     size_t bytes_read;
     int status = OK;
 
-    /* This will fail if the boundary spans fread() calls.  BUFSIZ should
+    /* This will fail if the boundary spans fread() calls.  NMH_BUFSIZ should
        be big enough, even if it's just 1024, to make that unlikely. */
 
     /* free_content() will close ct->c_fp. */
@@ -762,7 +762,7 @@ static int
 replace_boundary (CT ct, char *file, char *boundary) {
     FILE *fpin, *fpout;
     int compnum, state;
-    char buf[BUFSIZ], name[NAMESZ];
+    char buf[NMH_BUFSIZ], name[NAMESZ];
     char *np, *vp;
     m_getfld_state_t gstate = 0;
     int status = OK;
@@ -1780,7 +1780,7 @@ build_multipart_alt (CT first_alt, CT new_part, int type, int subtype) {
  */
 static int
 boundary_in_content (FILE **fp, char *file, const char *boundary) {
-    char buffer[BUFSIZ];
+    char buffer[NMH_BUFSIZ];
     size_t bytes_read;
     int found_boundary = 0;
 
@@ -2074,7 +2074,7 @@ content_encoding (CT ct, const char **reason) {
 
     if (ce->ce_file) {
         size_t line_len = 0;
-        char buffer[BUFSIZ];
+        char buffer[NMH_BUFSIZ];
         size_t inbytes;
 
         if (! ce->ce_fp  &&  (ce->ce_fp = fopen (ce->ce_file, "r")) == NULL) {
@@ -2169,7 +2169,7 @@ strip_crs (CT ct, int *message_mods) {
         }
 
         if (fp  &&  *fp) {
-            char buffer[BUFSIZ];
+            char buffer[NMH_BUFSIZ];
             size_t bytes_read;
             size_t bytes_to_read =
                 end > 0 && end > begin  ?  end - begin  :  sizeof buffer;
@@ -2635,7 +2635,7 @@ write_content (CT ct, const char *input_filename, char *outfile, int modify_inpl
                         int i = -1;
 
                         if (old != -1  &&  new != -1) {
-                            char buffer[BUFSIZ];
+                            char buffer[NMH_BUFSIZ];
 
                             while ((i = read (old, buffer, sizeof buffer)) >
                                    0) {