]> diplodocus.org Git - nmh/blobdiff - uip/slocal.c
Bump up size of two static char[] so gcc knows they won't overflow.
[nmh] / uip / slocal.c
index 4174d4a00e3552f7c08b5f0364e57673ce11a617..97897ad1053abd8f59bd9e451069316b1dd97405 100644 (file)
@@ -27,6 +27,8 @@
 #include <h/tws.h>
 #include <h/mts.h>
 #include <h/utils.h>
+#include "../sbr/lock_file.h"
+#include "../sbr/m_mktemp.h"
 
 #include <pwd.h>
 #include <sys/ioctl.h>
@@ -969,19 +971,11 @@ timely (char *t1, char *t2)
 static int
 usr_file (int fd, char *mailbox, int mbx_style)
 {
-    int        md, mapping;
+    int        md;
 
-    if (verbose)
-       verbose_printf ("delivering to file \"%s\"", mailbox);
-
-    if (mbx_style == MBOX_FORMAT) {
-       if (verbose)
-           verbose_printf (" (mbox style)");
-       mapping = 0;
-    } else {
-       if (verbose)
-           verbose_printf (" (mmdf style)");
-       mapping = 1;
+    if (verbose) {
+        verbose_printf("delivering to file \"%s\" (%s style)", mailbox,
+            mbx_style == MBOX_FORMAT ? "mbox" : "mmdf");
     }
 
     /* open and lock the file */
@@ -991,10 +985,10 @@ usr_file (int fd, char *mailbox, int mbx_style)
        return -1;
     }
 
-    lseek (fd, (off_t) 0, SEEK_SET);
+    lseek(fd, 0, SEEK_SET);
 
     /* append message to file */
-    if (mbx_copy (mailbox, mbx_style, md, fd, mapping, NULL, verbose) == -1) {
+    if (mbx_copy (mailbox, mbx_style, md, fd, NULL) == -1) {
        if (verbose)
            adorn ("", "error writing to:");
        return -1;
@@ -1057,7 +1051,7 @@ usr_pipe (int fd_arg, char *cmd, char *pgm, char **vec, int suppress)
     if (verbose && !suppress)
        verbose_printf ("delivering to pipe \"%s\"", cmd);
 
-    lseek (fd, (off_t) 0, SEEK_SET);
+    lseek(fd, 0, SEEK_SET);
 
     for (i = 0; (child_id = fork()) == -1 && i < 5; i++)
        sleep (5);
@@ -1218,7 +1212,7 @@ you_lose:
            }
        if (i == -1)
            goto you_lose;
-       lseek (fd1, (off_t) 0, SEEK_SET);
+       lseek(fd1, 0, SEEK_SET);
        return fd1;
     }
 
@@ -1283,7 +1277,7 @@ you_lose:
        return -1;
     }
     fclose (qfp);
-    lseek (fd1, (off_t) 0, SEEK_SET);
+    lseek(fd1, 0, SEEK_SET);
     return fd1;