]> diplodocus.org Git - nmh/blobdiff - uip/distsbr.c
Make sure we are in the correct directory when we do "git describe".
[nmh] / uip / distsbr.c
index 6fc7737..a4c4872 100644 (file)
@@ -8,6 +8,7 @@
 #include <h/mh.h>
 #include <fcntl.h>
 #include <h/utils.h>
+#include "../sbr/m_mktemp.h"
 
 static int  hdrfd = NOTOK;
 static int  txtfd = NOTOK;
@@ -27,7 +28,7 @@ distout (char *drft, char *msgnam, char *backup)
 {
     int state;
     char *dp, *resent;
-    char name[NAMESZ], buffer[BUFSIZ];
+    char name[NAMESZ], buffer[NMH_BUFSIZ];
     FILE *ifp, *ofp;
     m_getfld_state_t gstate = 0;
 
@@ -124,15 +125,19 @@ static void
 ready_msg (char *msgnam)
 {
     int state, out;
-    char name[NAMESZ], buffer[BUFSIZ], tmpfil[BUFSIZ];
+    char name[NAMESZ], buffer[NMH_BUFSIZ], tmpfil[BUFSIZ];
     FILE *ifp, *ofp;
     char *cp = NULL;
     m_getfld_state_t gstate = 0;
 
-    if (hdrfd != NOTOK)
-       close (hdrfd), hdrfd = NOTOK;
-    if (txtfd != NOTOK)
-       close (txtfd), txtfd = NOTOK;
+    if (hdrfd != NOTOK) {
+        close (hdrfd);
+        hdrfd = NOTOK;
+    }
+    if (txtfd != NOTOK) {
+        close (txtfd);
+        txtfd = NOTOK;
+    }
 
     if ((ifp = fopen (msgnam, "r")) == NULL)
        adios (msgnam, "unable to open message");