X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fspost.c;h=f2d6311a2a3425110b7d54f49f6d72033da52fd7;hp=7d65eadac6e374be4d0f55f9afa5c7f136b3b034;hb=045b9601403a216c400642229f2b291f85f88f7d;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/uip/spost.c b/uip/spost.c index 7d65ead..f2d6311 100644 --- a/uip/spost.c +++ b/uip/spost.c @@ -311,8 +311,15 @@ main (int argc, char **argv) continue; case LIBSW: + if (!(cp = *argp++) || *cp == '-') + adios (NULL, "missing argument to %s", argp[-2]); + /* create a minimal context */ + if (context_foil (cp) == -1) + done(1); + continue; + case ANNOSW: - /* -library & -idanno switch ignored */ + /* -idanno switch ignored */ if (!(cp = *argp++) || *cp == '-') adios (NULL, "missing argument to %s", argp[-2]); continue; @@ -339,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; @@ -443,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 */ @@ -478,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); } @@ -493,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 @@ -520,6 +533,7 @@ putfmt (char *name, char *str, FILE *out) } else { fprintf (out, "%s: %s", name, str ); } + } }