configure, configure.in stamp-h.in, and uip/Makefile.in modified to fix
[mmh] / uip / spost.c
index 58d4ae3..f2d6311 100644 (file)
@@ -346,10 +346,15 @@ main (int argc, char **argv)
        out = stdout;
     }
     else {
+#ifdef HAVE_MKSTEMP
+           if ((out = fdopen( mkstemp (tmpfil), "w" )) == NULL )
+               adios (tmpfil, "unable to create");
+#else
            mktemp (tmpfil);
            if ((out = fopen (tmpfil, "w")) == NULL)
                adios (tmpfil, "unable to create");
            chmod (tmpfil, 0600);
+#endif
        }
 
     hdrtab = (msgstate == normal) ? NHeaders : RHeaders;
@@ -450,6 +455,7 @@ main (int argc, char **argv)
     }
     execv ( sendmail, sargv);
     adios ( sendmail, "can't exec");
+    return 0;  /* dead code to satisfy the compiler */
 }
 
 /* DRAFT GENERATION */
@@ -485,7 +491,7 @@ putfmt (char *name, char *str, FILE *out)
     if (hdr->flags & HFCC) {
        if ((cp = strrchr(str, '\n')))
            *cp = 0;
-       for (cp = pp = str; cp = strchr(pp, ','); pp = cp) {
+       for (cp = pp = str; (cp = strchr(pp, ',')); pp = cp) {
            *cp++ = 0;
            insert_fcc (hdr, pp);
        }
@@ -500,7 +506,7 @@ putfmt (char *name, char *str, FILE *out)
     }
 #endif /* notdef */
 
-    if (*str != '\n' && *str != '\0')
+    if (*str != '\n' && *str != '\0') {
        if (aliasflg && hdr->flags & HTRY) {
            /* this header contains address(es) that we have to do
             * alias expansion on.  Because of the saved state in
@@ -527,6 +533,7 @@ putfmt (char *name, char *str, FILE *out)
        } else {
            fprintf (out, "%s: %s", name, str );
        }
+    }
 }