projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Put in a prototype for client() to get rid of the "default prototype" warning.
[mmh]
/
uip
/
spost.c
diff --git
a/uip/spost.c
b/uip/spost.c
index
7d65ead
..
1f3b014
100644
(file)
--- a/
uip/spost.c
+++ b/
uip/spost.c
@@
-14,6
+14,7
@@
#include <h/aliasbr.h>
#include <h/dropsbr.h>
#include <zotnet/tws/tws.h>
#include <h/aliasbr.h>
#include <h/dropsbr.h>
#include <zotnet/tws/tws.h>
+#include <zotnet/mts/mts.h>
#define uptolow(c) ((isalpha(c) && isupper (c)) ? tolower (c) : c)
#define uptolow(c) ((isalpha(c) && isupper (c)) ? tolower (c) : c)
@@
-311,8
+312,15
@@
main (int argc, char **argv)
continue;
case LIBSW:
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:
case ANNOSW:
- /* -library & -idanno switch ignored */
+ /* -idanno switch ignored */
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
continue;
if (!(cp = *argp++) || *cp == '-')
adios (NULL, "missing argument to %s", argp[-2]);
continue;
@@
-339,10
+347,15
@@
main (int argc, char **argv)
out = stdout;
}
else {
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);
mktemp (tmpfil);
if ((out = fopen (tmpfil, "w")) == NULL)
adios (tmpfil, "unable to create");
chmod (tmpfil, 0600);
+#endif
}
hdrtab = (msgstate == normal) ? NHeaders : RHeaders;
}
hdrtab = (msgstate == normal) ? NHeaders : RHeaders;
@@
-443,6
+456,7
@@
main (int argc, char **argv)
}
execv ( sendmail, sargv);
adios ( sendmail, "can't exec");
}
execv ( sendmail, sargv);
adios ( sendmail, "can't exec");
+ return 0; /* dead code to satisfy the compiler */
}
/* DRAFT GENERATION */
}
/* DRAFT GENERATION */
@@
-478,7
+492,7
@@
putfmt (char *name, char *str, FILE *out)
if (hdr->flags & HFCC) {
if ((cp = strrchr(str, '\n')))
*cp = 0;
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);
}
*cp++ = 0;
insert_fcc (hdr, pp);
}
@@
-493,7
+507,7
@@
putfmt (char *name, char *str, FILE *out)
}
#endif /* notdef */
}
#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
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
+534,7
@@
putfmt (char *name, char *str, FILE *out)
} else {
fprintf (out, "%s: %s", name, str );
}
} else {
fprintf (out, "%s: %s", name, str );
}
+ }
}
}