aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-05-15 16:09:24 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-05-15 16:09:24 +0000
commit3dd9a93bd23e0ad36e52ffd79efe2dcbdaf85272 (patch)
tree8b0bf1472eb20208cd2295619f14d70941fffe57
parent60389620d98dd09d4722f078b3523c6a0425f173 (diff)
downloadfetchmail-3dd9a93bd23e0ad36e52ffd79efe2dcbdaf85272.tar.gz
fetchmail-3dd9a93bd23e0ad36e52ffd79efe2dcbdaf85272.tar.bz2
fetchmail-3dd9a93bd23e0ad36e52ffd79efe2dcbdaf85272.zip
-Wall cleanup.
svn path=/trunk/; revision=1011
-rw-r--r--daemon.c1
-rw-r--r--driver.c16
-rw-r--r--etrn.c4
-rw-r--r--fetchmail.c3
-rw-r--r--fetchmail.h2
-rw-r--r--imap.c10
-rw-r--r--report.c6
-rw-r--r--smtp.c2
8 files changed, 20 insertions, 24 deletions
diff --git a/daemon.c b/daemon.c
index a0847731..68c509db 100644
--- a/daemon.c
+++ b/daemon.c
@@ -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>
diff --git a/driver.c b/driver.c
index f0ed9f2c..0cdbeceb 100644
--- a/driver.c
+++ b/driver.c
@@ -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';
diff --git a/etrn.c b/etrn.c
index b8e8fffa..c931d2cc 100644
--- a/etrn.c
+++ b/etrn.c
@@ -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
diff --git a/imap.c b/imap.c
index 8331bc53..938c5f0a 100644
--- a/imap.c
+++ b/imap.c
@@ -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[]" */
diff --git a/report.c b/report.c
index f5c2110d..45fba868 100644
--- a/report.c
+++ b/report.c
@@ -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
diff --git a/smtp.c b/smtp.c
index 1608a63a..867db2c8 100644
--- a/smtp.c
+++ b/smtp.c
@@ -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);