diff options
-rw-r--r-- | daemon.c | 1 | ||||
-rw-r--r-- | driver.c | 16 | ||||
-rw-r--r-- | etrn.c | 4 | ||||
-rw-r--r-- | fetchmail.c | 3 | ||||
-rw-r--r-- | fetchmail.h | 2 | ||||
-rw-r--r-- | imap.c | 10 | ||||
-rw-r--r-- | report.c | 6 | ||||
-rw-r--r-- | smtp.c | 2 |
8 files changed, 20 insertions, 24 deletions
@@ -12,6 +12,7 @@ #include <sys/types.h> #include <sys/wait.h> #include <sys/fcntl.h> /* Solaris 2.5 requires this */ +#include <sys/stat.h> /* get umask(2) prototyped */ #if defined(HAVE_UNISTD_H) #include <unistd.h> @@ -231,7 +231,7 @@ struct idlist **xmit_names; /* list of recipient names parsed out */ return; else { - char *cp, *lname; + char *cp; if ((cp = nxtaddr(hdr)) != (char *)NULL) do { @@ -441,9 +441,6 @@ char *realname; /* real name of host */ int n, linelen, oldlen, ch, sizeticker, delete_ok, remaining; FILE *sinkfp; RETSIGTYPE (*sigchld)(); -#ifdef HAVE_GETHOSTBYNAME - char rbuf[HOSTLEN + USERNAMELEN + 4]; -#endif /* HAVE_GETHOSTBYNAME */ char *cp; struct idlist *idp, *xmit_names; int good_addresses, bad_addresses, has_nuls; @@ -478,7 +475,7 @@ char *realname; /* real name of host */ if (ctl->forcecr) { cp = buf + strlen(buf) - 1; - if (cp > buf && *cp == '\n' && cp[-1] != '\r') + if (*cp == '\n' && (cp == buf || cp[-1] != '\r')) { *cp++ = '\r'; *cp++ = '\n'; @@ -750,7 +747,6 @@ char *realname; /* real name of host */ else { char *ap, *ctt, options[MSGBUFSIZE]; - int smtperr; /* build a connection to the SMTP listener */ if (!ctl->mda && (smtp_open(ctl) == -1)) @@ -774,11 +770,11 @@ char *realname; /* real name of host */ && (ctt_offs >= 0) && (ctt = nxtaddr(headers + ctt_offs))) if (!strcasecmp(ctt,"7BIT")) - sprintf(options, " BODY=7BIT", ctt); + sprintf(options, " BODY=7BIT"); else if (!strcasecmp(ctt,"8BIT")) - sprintf(options, " BODY=8BITMIME", ctt); + sprintf(options, " BODY=8BITMIME"); if ((ctl->server.esmtp_options & ESMTP_SIZE) && !delimited) - sprintf(options + strlen(options), " SIZE=%d", len); + sprintf(options + strlen(options), " SIZE=%ld", len); /* * If there is a Return-Path address on the message, this was @@ -1066,7 +1062,7 @@ char *realname; /* real name of host */ if (ctl->forcecr) { cp = buf + strlen(buf) - 1; - if (cp > buf && *cp == '\n' && cp[-1] != '\r') + if (*cp == '\n' && (cp == buf || cp[-1] != '\r')) { *cp++ = '\r'; *cp++ = '\n'; @@ -6,6 +6,7 @@ #include <config.h> #include <stdio.h> +#include <stdlib.h> #include "fetchmail.h" #include "smtp.h" #include "socket.h" @@ -14,7 +15,6 @@ static int etrn_ok (int sock, char *argbuf) /* parse command response */ { int ok; - char buf [POPBUFSIZE+1]; ok = SMTP_ok(sock); if (ok == SM_UNRECOVERABLE) @@ -46,7 +46,7 @@ static int etrn_getrange(int sock, struct query *ctl, int*countp, int*newp) /* ship the actual poll and get the response */ gen_send(sock, "ETRN %s", ctl->smtphost); - if (ok = gen_recv(sock, buf, sizeof(buf))) + if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); /* this switch includes all the response codes described in RFC1985 */ diff --git a/fetchmail.c b/fetchmail.c index 7e0710c2..fbc16d9a 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -919,8 +919,7 @@ void dump_params (struct query *ctl) } printf(" DNS lookup for multidrop addresses is %sabled.\n", - ctl->server.dns ? "en" : "dis", - ctl->server.dns ? "off" : "on"); + ctl->server.dns ? "en" : "dis"); if (count > 1) if (ctl->server.envelope == STRING_DISABLED) diff --git a/fetchmail.h b/fetchmail.h index 3dc569a3..a50659e5 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -189,6 +189,7 @@ void error_init(int foreground); void error (int status, int errnum, const char *format, ...); void error_build (const char *format, ...); void error_complete (int status, int errnum, const char *format, ...); +void error_at_line (int, int, const char *, unsigned int, const char *, ...); void gen_send (int sock, char *, ... ); int gen_recv(int sock, char *buf, int size); int gen_transact (int sock, char *, ... ); @@ -196,6 +197,7 @@ int gen_transact (int sock, char *, ... ); void error (); void error_build (); void error_complete (); +void error_at_line (); void gen_send (); int gen_transact (); #endif @@ -34,7 +34,7 @@ int imap_ok (int sock, char *argbuf) do { int ok; - if (ok = gen_recv(sock, buf, sizeof(buf))) + if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); /* interpret untagged status responses */ @@ -91,7 +91,7 @@ int imap_getauth(int sock, struct query *ctl, char *buf) /* probe to see if we're running IMAP4 and can use RFC822.PEEK */ gen_send(sock, "CAPABILITY"); - if (ok = gen_recv(sock, rbuf, sizeof(rbuf))) + if ((ok = gen_recv(sock, rbuf, sizeof(rbuf)))) return(ok); if (strstr(rbuf, "BAD")) { @@ -157,7 +157,7 @@ static int imap_getsizes(int sock, int count, int *sizes) { int num, size, ok; - if (ok = gen_recv(sock, buf, sizeof(buf))) + if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); if (strstr(buf, "OK")) break; @@ -187,7 +187,7 @@ static int imap_is_old(int sock, struct query *ctl, int number) static int imap_fetch(int sock, struct query *ctl, int number, int *lenp) /* request nth message */ { - char buf [POPBUFSIZE+1], *fetch; + char buf [POPBUFSIZE+1]; int num; /* expunges change the fetch numbers */ @@ -228,7 +228,7 @@ static int imap_fetch(int sock, struct query *ctl, int number, int *lenp) do { int ok; - if (ok = gen_recv(sock, buf, sizeof(buf))) + if ((ok = gen_recv(sock, buf, sizeof(buf)))) return(ok); } while /* third token can be "RFC822" or "BODY[]" */ @@ -258,8 +258,8 @@ int foreground; empty) by calling error_complete(). If an intervening call to error() occurs when a partially constructed message exists, then, in an attempt to keep the messages in their proper - sequence, the partial message will be printed as-is (with a trailing newline) - before error() prints its message. + sequence, the partial message will be printed as-is (with a trailing + newline) before error() prints its message. */ /* VARARGS */ void @@ -359,7 +359,7 @@ error_build (message, va_alist) /* Complete an error message by appending MESSAGE, which is a printf-style format string with optional args, to the existing error message (which may be empty.) The completed error message is then printed (and reset to - empty.) + empty.) */ /* VARARGS */ void @@ -48,7 +48,6 @@ int SMTP_helo(int sock,char *host) int SMTP_ehlo(int sock, char *host, int *opt) /* send a "EHLO" message to the SMTP listener, return extension status bits */ { - int ok; struct opt *hp; SockPrintf(sock,"EHLO %s\r\n", host); @@ -84,7 +83,6 @@ int SMTP_from(int sock, char *from, char *opts) /* send a "MAIL FROM:" message to the SMTP listener */ { int ok; - struct opt *hp; char buf[MSGBUFSIZE]; sprintf(buf, "MAIL FROM:<%s>", from); |