X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fspost.c;h=1f3b014b8fb74a79c02c3af17677e40362eae931;hb=b986c0df2a745f3f5f5f4a4a6ccc384125bafbc7;hp=c5b27a08b6f0f051cc6bc32f41d30cee21354417;hpb=0ccd1945560c715e4cc4063209bd0d68b75d5470;p=mmh diff --git a/uip/spost.c b/uip/spost.c index c5b27a0..1f3b014 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -14,6 +14,7 @@ #include #include #include +#include #define uptolow(c) ((isalpha(c) && isupper (c)) ? tolower (c) : c) @@ -347,13 +348,14 @@ main (int argc, char **argv) } else { #ifdef HAVE_MKSTEMP - mkstemp (tmpfil); + if ((out = fdopen( mkstemp (tmpfil), "w" )) == NULL ) + adios (tmpfil, "unable to create"); #else mktemp (tmpfil); -#endif if ((out = fopen (tmpfil, "w")) == NULL) adios (tmpfil, "unable to create"); chmod (tmpfil, 0600); +#endif } hdrtab = (msgstate == normal) ? NHeaders : RHeaders; @@ -454,6 +456,7 @@ main (int argc, char **argv) } execv ( sendmail, sargv); adios ( sendmail, "can't exec"); + return 0; /* dead code to satisfy the compiler */ } /* DRAFT GENERATION */ @@ -489,7 +492,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); } @@ -504,7 +507,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 @@ -531,6 +534,7 @@ putfmt (char *name, char *str, FILE *out) } else { fprintf (out, "%s: %s", name, str ); } + } }