aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--daemon.c6
-rw-r--r--driver.c39
-rw-r--r--env.c3
-rw-r--r--etrn.c3
-rw-r--r--fetchmail.c2
-rw-r--r--fetchmail.h6
-rw-r--r--getpass.c1
-rw-r--r--imap.c38
-rw-r--r--kerberos.c6
-rw-r--r--mxget.c1
-rw-r--r--odmr.c2
-rw-r--r--opie.c2
-rw-r--r--options.c2
-rw-r--r--pop2.c12
-rw-r--r--pop3.c12
-rw-r--r--rcfile_l.l2
-rw-r--r--rpa.c6
-rw-r--r--sink.c3
-rw-r--r--smbencrypt.c3
-rw-r--r--strlcat.c2
-rw-r--r--strlcpy.c2
-rw-r--r--unmime.c2
23 files changed, 95 insertions, 61 deletions
diff --git a/NEWS b/NEWS
index 344df4b5..702f76a5 100644
--- a/NEWS
+++ b/NEWS
@@ -52,6 +52,7 @@ fetchmail 6.3.3 (not yet released):
* fix bug in LMTP port validation (patch by Miloslav Trmac).
* Miloslav Trmac's patch (with minor changes) to fix char * sign consistency.
* Warn and disable SDPS if POP3 is disabled to avoid compilation errors.
+* More signedness, unused argument/variable and other warning fixes.
# CHANGES:
* --idle can now be specified on the command line, too.
diff --git a/daemon.c b/daemon.c
index dabfb9a6..7416437d 100644
--- a/daemon.c
+++ b/daemon.c
@@ -58,7 +58,6 @@ sigchld_handler (int sig)
/* process SIGCHLD to obtain the exit code of the terminating process */
{
pid_t pid;
-
#if defined(HAVE_WAITPID) /* the POSIX way */
int status;
@@ -79,9 +78,10 @@ sigchld_handler (int sig)
wait(&status);
#endif
lastsig = SIGCHLD;
+ (void)sig;
}
-RETSIGTYPE null_signal_handler(int sig) { }
+RETSIGTYPE null_signal_handler(int sig) { (void)sig; }
SIGHANDLERTYPE set_signal_handler(int sig, SIGHANDLERTYPE handler)
/*
@@ -132,7 +132,7 @@ void deal_with_sigchld(void)
}
int
-daemonize (const char *logfile, void (*termhook)(int))
+daemonize (const char *logfile)
/* detach from control TTY, become process group leader, catch SIGCHLD */
{
int fd;
diff --git a/driver.c b/driver.c
index 93e8a086..250a1bff 100644
--- a/driver.c
+++ b/driver.c
@@ -105,6 +105,7 @@ void set_timeout(int timeleft)
static RETSIGTYPE timeout_handler (int signal)
/* handle SIGALRM signal indicating a server timeout */
{
+ (void)signal;
if(stage != STAGE_IDLE) {
timeoutcount++;
longjmp(restart, THROW_TIMEOUT);
@@ -115,6 +116,7 @@ static RETSIGTYPE timeout_handler (int signal)
static RETSIGTYPE sigpipe_handler (int signal)
/* handle SIGPIPE signal indicating a broken stream socket */
{
+ (void)signal;
longjmp(restart, THROW_SIGPIPE);
}
@@ -140,7 +142,6 @@ int socket; /* socket to server host */
char *canonical; /* server name */
char *principal;
{
- char * host_primary;
KTEXT ticket;
MSG_DAT msg_data;
CREDENTIALS cred;
@@ -214,19 +215,19 @@ const char *canonical; /* server name */
krb5_init_context(&context);
krb5_auth_con_init(context, &auth_context);
- if (retval = krb5_cc_default(context, &ccdef)) {
+ if ((retval = krb5_cc_default(context, &ccdef))) {
report(stderr, "krb5_cc_default: %s\n", error_message(retval));
return(PS_ERROR);
}
- if (retval = krb5_cc_get_principal(context, ccdef, &client)) {
+ if ((retval = krb5_cc_get_principal(context, ccdef, &client))) {
report(stderr, "krb5_cc_get_principal: %s\n", error_message(retval));
return(PS_ERROR);
}
- if (retval = krb5_sname_to_principal(context, canonical, "pop",
+ if ((retval = krb5_sname_to_principal(context, canonical, "pop",
KRB5_NT_UNKNOWN,
- &server)) {
+ &server))) {
report(stderr, "krb5_sname_to_principal: %s\n", error_message(retval));
return(PS_ERROR);
}
@@ -331,7 +332,7 @@ static void send_size_warnings(struct query *ctl)
* but it's not a disaster, either, since the skipped mail will not
* be deleted.
*/
- if (open_warning_by_mail(ctl, (struct msgblk *)NULL))
+ if (open_warning_by_mail(ctl))
return;
stuff_warning(iana_charset, ctl,
GT_("Subject: Fetchmail oversized-messages warning"));
@@ -380,7 +381,7 @@ static void send_size_warnings(struct query *ctl)
close_warning_by_mail(ctl, (struct msgblk *)NULL);
}
-static void mark_oversized(struct query *ctl, int num, int size)
+static void mark_oversized(struct query *ctl, int size)
/* mark a message oversized */
{
struct idlist *current=NULL, *tmp=NULL;
@@ -546,7 +547,7 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
{
if (msgcode == MSGLEN_TOOLARGE)
{
- mark_oversized(ctl, num, msgsize);
+ mark_oversized(ctl, msgsize);
if (!ctl->limitflush)
suppress_delete = TRUE;
}
@@ -647,7 +648,7 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
fflush(stdout);
}
- if ((err = (ctl->server.base_protocol->trail)(mailserver_socket, ctl, num, tag)))
+ if ((err = (ctl->server.base_protocol->trail)(mailserver_socket, ctl, tag)))
return(err);
}
@@ -705,7 +706,7 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
fflush(stdout);
}
- err = (ctl->server.base_protocol->trail)(mailserver_socket, ctl, num, tag);
+ err = (ctl->server.base_protocol->trail)(mailserver_socket, ctl, tag);
if (err != 0)
return(err);
}
@@ -913,7 +914,7 @@ static int do_session(
* timeouts just mean the frequency of mail is low.
*/
if (timeoutcount > MAX_TIMEOUTS
- && !open_warning_by_mail(ctl, (struct msgblk *)NULL))
+ && !open_warning_by_mail(ctl))
{
stuff_warning(iana_charset, ctl,
GT_("Subject: fetchmail sees repeated timeouts"));
@@ -1068,7 +1069,7 @@ static int do_session(
* where your SLIP or PPP link is down...
*/
/* warn the system administrator */
- if (open_warning_by_mail(ctl, (struct msgblk *)NULL) == 0)
+ if (open_warning_by_mail(ctl) == 0)
{
stuff_warning(iana_charset, ctl,
GT_("Subject: Fetchmail unreachable-server warning."));
@@ -1181,7 +1182,7 @@ static int do_session(
&& !ctl->wehavesentauthnote
&& ((ctl->wehaveauthed && ++ctl->authfailcount >= 10)
|| (!ctl->wehaveauthed && ++ctl->authfailcount >= 3))
- && !open_warning_by_mail(ctl, (struct msgblk *)NULL))
+ && !open_warning_by_mail(ctl))
{
ctl->wehavesentauthnote = 1;
stuff_warning(iana_charset, ctl,
@@ -1192,13 +1193,14 @@ static int do_session(
GT_("Fetchmail could not get mail from %s@%s.\n"),
ctl->remotename,
ctl->server.truename);
- if (ctl->wehaveauthed)
+ if (ctl->wehaveauthed) {
stuff_warning(NULL, ctl, GT_("\
The attempt to get authorization failed.\n\
Since we have already succeeded in getting authorization for this\n\
connection, this is probably another failure mode (such as busy server)\n\
that fetchmail cannot distinguish because the server didn't send a useful\n\
-error message.\n\
+error message."));
+ stuff_warning(NULL, ctl, GT_("\
\n\
However, if you HAVE changed your account details since starting the\n\
fetchmail daemon, you need to stop the daemon, change your configuration\n\
@@ -1207,7 +1209,7 @@ of fetchmail, and then restart the daemon.\n\
The fetchmail daemon will continue running and attempt to connect\n\
at each cycle. No future notifications will be sent until service\n\
is restored."));
- else
+ } else {
stuff_warning(NULL, ctl, GT_("\
The attempt to get authorization failed.\n\
This probably means your password is invalid, but some servers have\n\
@@ -1217,6 +1219,7 @@ because they don't send useful error messages on login failure.\n\
The fetchmail daemon will continue running and attempt to connect\n\
at each cycle. No future notifications will be sent until service\n\
is restored."));
+ }
close_warning_by_mail(ctl, (struct msgblk *)NULL);
}
}
@@ -1255,7 +1258,7 @@ is restored."));
GT_("Authorization OK on %s@%s\n"),
ctl->remotename,
ctl->server.truename);
- if (!open_warning_by_mail(ctl, (struct msgblk *)NULL))
+ if (!open_warning_by_mail(ctl))
{
stuff_warning(iana_charset, ctl,
GT_("Subject: fetchmail authentication OK on %s@%s"),
@@ -1372,7 +1375,7 @@ is restored."));
* count, and allocate a malloc area that would overlap
* a portion of the stack.
*/
- if (count > INT_MAX/sizeof(int))
+ if ((unsigned)count > INT_MAX/sizeof(int))
{
report(stderr, GT_("bogus message count!"));
err = PS_PROTOCOL;
diff --git a/env.c b/env.c
index 4b74d368..457255af 100644
--- a/env.c
+++ b/env.c
@@ -37,6 +37,9 @@ void envquery(int argc, char **argv)
{
struct passwd by_name, by_uid, *pwp;
+ (void)argc;
+
+ (void)argc;
if (!(user = getenv("FETCHMAILUSER")))
{
if (!(user = getenv("LOGNAME")))
diff --git a/etrn.c b/etrn.c
index f4b05f09..27441604 100644
--- a/etrn.c
+++ b/etrn.c
@@ -25,6 +25,7 @@ static int etrn_ok (int sock, char *argbuf)
{
int ok;
+ (void)argbuf;
ok = SMTP_ok(sock, SMTP_MODE);
if (ok == SM_UNRECOVERABLE)
return(PS_PROTOCOL);
@@ -40,6 +41,7 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id,
char buf [MSGBUFSIZE+1];
struct idlist *qnp; /* pointer to Q names */
+ (void)id;
if ((ok = SMTP_ehlo(sock, SMTP_MODE, fetchmailhost,
ctl->server.esmtp_name, ctl->server.esmtp_password,
&opts)))
@@ -116,6 +118,7 @@ static int etrn_getrange(int sock, struct query *ctl, const char *id,
static int etrn_logout(int sock, struct query *ctl)
/* send logout command */
{
+ (void)ctl;
return(gen_transact(sock, "QUIT"));
}
diff --git a/fetchmail.c b/fetchmail.c
index 4e56c08a..6325d8f9 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -546,7 +546,7 @@ int main(int argc, char **argv)
if (run.poll_interval)
{
if (!nodetach)
- daemonize(run.logfile, terminate_run);
+ daemonize(run.logfile);
report(stdout, GT_("starting fetchmail %s daemon \n"), VERSION);
/*
diff --git a/fetchmail.h b/fetchmail.h
index 3deeb63e..a687372e 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -216,7 +216,7 @@ struct method /* describe methods for protocol state machine */
/* fetch FROM headera given message */
int (*fetch_body)(int, struct query *, int, int *);
/* fetch a given message */
- int (*trail)(int, struct query *, int, const char *);
+ int (*trail)(int, struct query *, const char *);
/* eat trailer of a message */
int (*delete_msg)(int, struct query *, int);
/* delete method */
@@ -548,7 +548,7 @@ int stuffline(struct query *, char *);
int open_sink(struct query*, struct msgblk *, int*, int*);
void release_sink(struct query *);
int close_sink(struct query *, struct msgblk *, flag);
-int open_warning_by_mail(struct query *, struct msgblk *);
+int open_warning_by_mail(struct query *);
#if defined(HAVE_STDARG_H)
void stuff_warning(const char *, struct query *, const char *, ... )
__attribute__ ((format (printf, 3, 4)))
@@ -650,7 +650,7 @@ typedef RETSIGTYPE (*SIGHANDLERTYPE) (int);
void deal_with_sigchld(void);
RETSIGTYPE null_signal_handler(int sig);
SIGHANDLERTYPE set_signal_handler(int sig, SIGHANDLERTYPE handler);
-int daemonize(const char *, void (*)(int));
+int daemonize(const char *);
char *fm_getpassword(char *);
void escapes(const char *, char *);
char *visbuf(const char *);
diff --git a/getpass.c b/getpass.c
index 7010209f..12f58627 100644
--- a/getpass.c
+++ b/getpass.c
@@ -189,6 +189,7 @@ static void restore_tty_state(void)
static RETSIGTYPE sigint_handler(int signum)
{
+ (void)signum;
restore_tty_state();
report(stderr, GT_("\nCaught SIGINT... bailing out.\n"));
exit(1);
diff --git a/imap.c b/imap.c
index 619c0a6a..a877a590 100644
--- a/imap.c
+++ b/imap.c
@@ -84,7 +84,7 @@ static int imap_ok(int sock, char *argbuf)
* count, and allocate a malloc area that would overlap
* a portion of the stack.
*/
- if (count > INT_MAX/sizeof(int))
+ if ((unsigned)count > INT_MAX/sizeof(int))
{
report(stderr, GT_("bogus message count!"));
return(PS_PROTOCOL);
@@ -351,6 +351,7 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
flag did_stls = FALSE;
#endif /* SSL_ENABLE */
+ (void)greeting;
/*
* Assumption: expunges are cheap, so we want to do them
* after every message unless user said otherwise.
@@ -804,17 +805,15 @@ static int imap_getrange(int sock,
cp++;
if (*cp)
{
- unsigned int um;
- /*
- * Message numbers are between 1 and 2^32 inclusive,
- * so unsigned int is large enough.
- */
- um=(unsigned int)strtol(cp,&ep,10);
- if (um <= count)
+ unsigned long um;
+
+ errno = 0;
+ um = strtoul(cp,&ep,10);
+ if (errno == 0 && um <= UINT_MAX && um <= (unsigned)count)
{
unseen_messages[unseen++] = um;
if (outlevel >= O_DEBUG)
- report(stdout, GT_("%u is unseen\n"), um);
+ report(stdout, GT_("%lu is unseen\n"), um);
if (startcount > um)
startcount = um;
}
@@ -889,8 +888,8 @@ static int imap_getpartialsizes(int sock, int first, int last, int *sizes)
return(PS_SUCCESS);
for (;;)
{
- unsigned int num, size;
- int ok;
+ unsigned int size;
+ int ok, num;
char *cp;
if ((ok = gen_recv(sock, buf, sizeof(buf))))
@@ -903,7 +902,7 @@ static int imap_getpartialsizes(int sock, int first, int last, int *sizes)
;
else if (strstr(buf, "OK") || strstr(buf, "NO"))
break;
- else if (sscanf(buf, "* %u FETCH (RFC822.SIZE %u)", &num, &size) == 2
+ else if (sscanf(buf, "* %d FETCH (RFC822.SIZE %u)", &num, &size) == 2
/* some servers (like mail.internode.on.net bld-mail04) return UID information here
*
* IMAP> A0005 FETCH 1 RFC822.SIZE
@@ -911,7 +910,7 @@ static int imap_getpartialsizes(int sock, int first, int last, int *sizes)
* IMAP< A0005 OK FETCH completed
*
*/
- || sscanf(buf, "* %u FETCH (UID %*s RFC822.SIZE %u)", &num, &size) == 2)
+ || sscanf(buf, "* %d FETCH (UID %*s RFC822.SIZE %u)", &num, &size) == 2)
{
if (num >= first && num <= last)
sizes[num - first] = size;
@@ -936,6 +935,8 @@ static int imap_is_old(int sock, struct query *ctl, int number)
flag seen = TRUE;
int i;
+ (void)sock;
+ (void)ctl;
/*
* Expunges change the fetch numbers, but unseen_messages contains
* indices from before any expungees were done. So neither the
@@ -944,7 +945,7 @@ static int imap_is_old(int sock, struct query *ctl, int number)
seen = TRUE;
for (i = 0; i < unseen; i++)
- if (unseen_messages[i] == number)
+ if (unseen_messages[i] == (unsigned)number)
{
seen = FALSE;
break;
@@ -967,6 +968,7 @@ static int imap_fetch_headers(int sock, struct query *ctl,int number,int *lenp)
char buf [MSGBUFSIZE+1];
int num;
+ (void)ctl;
/* expunges change the fetch numbers */
number -= expunged;
@@ -1026,6 +1028,7 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp)
char buf [MSGBUFSIZE+1], *cp;
int num;
+ (void)ctl;
/* expunges change the fetch numbers */
number -= expunged;
@@ -1094,12 +1097,13 @@ static int imap_fetch_body(int sock, struct query *ctl, int number, int *lenp)
return(PS_SUCCESS);
}
-static int imap_trail(int sock, struct query *ctl, int number, const char *tag)
+static int imap_trail(int sock, struct query *ctl, const char *tag)
/* discard tail of FETCH response after reading message text */
{
/* expunges change the fetch numbers */
/* number -= expunged; */
+ (void)ctl;
for (;;)
{
char buf[MSGBUFSIZE+1], *t;
@@ -1125,6 +1129,7 @@ static int imap_delete(int sock, struct query *ctl, int number)
{
int ok;
+ (void)ctl;
/* expunges change the fetch numbers */
number -= expunged;
@@ -1165,6 +1170,7 @@ static int imap_delete(int sock, struct query *ctl, int number)
static int imap_mark_seen(int sock, struct query *ctl, int number)
/* mark the given message as seen */
{
+ (void)ctl;
return(gen_transact(sock,
imap_version == IMAP4
? "STORE %d +FLAGS.SILENT (\\Seen)"
@@ -1175,6 +1181,7 @@ static int imap_mark_seen(int sock, struct query *ctl, int number)
static int imap_end_mailbox_poll(int sock, struct query *ctl)
/* cleanup mailbox before we idle or switch to another one */
{
+ (void)ctl;
if (deletions)
internal_expunge(sock);
return(PS_SUCCESS);
@@ -1183,6 +1190,7 @@ static int imap_end_mailbox_poll(int sock, struct query *ctl)
static int imap_logout(int sock, struct query *ctl)
/* send logout command */
{
+ (void)ctl;
/* if any un-expunged deletions remain, ship an expunge now */
if (deletions)
internal_expunge(sock);
diff --git a/kerberos.c b/kerberos.c
index 15c8ee7e..0eb51477 100644
--- a/kerberos.c
+++ b/kerberos.c
@@ -65,7 +65,7 @@ int do_rfc1731(int sock, char *command, char *truename)
* in network byte order.
*/
- if (result = gen_recv(sock, buf1, sizeof buf1)) {
+ if ((result = gen_recv(sock, buf1, sizeof buf1)) != 0) {
return result;
}
@@ -103,7 +103,7 @@ int do_rfc1731(int sock, char *command, char *truename)
strncpy(srvrealm, (char *)krb_realmofhost(srvinst), (sizeof srvrealm)-1);
srvrealm[(sizeof srvrealm)-1] = '\0';
- if (p = strchr(srvinst, '.')) {
+ if ((p = strchr(srvinst, '.')) != NULL) {
*p = '\0';
}
@@ -186,7 +186,7 @@ int do_rfc1731(int sock, char *command, char *truename)
* checksum it previously sent.
*/
- if (result = gen_recv(sock, buf1, sizeof buf1))
+ if ((result = gen_recv(sock, buf1, sizeof buf1)) != 0)
return result;
/* The client must construct data with the first four octets
diff --git a/mxget.c b/mxget.c
index 21a36682..03003362 100644
--- a/mxget.c
+++ b/mxget.c
@@ -124,7 +124,6 @@ struct mxentry *getmxrecords(const char *name)
int main(int argc, char *argv[])
{
- int count, i;
struct mxentry *responses;
if (argc != 2 || 0 == strcmp(argv[1], "-h")) {
diff --git a/odmr.c b/odmr.c
index 18ef2e63..cb0d559a 100644
--- a/odmr.c
+++ b/odmr.c
@@ -35,6 +35,7 @@ static int odmr_ok (int sock, char *argbuf)
{
int ok;
+ (void)argbuf;
ok = SMTP_ok(sock, SMTP_MODE);
if (ok == SM_UNRECOVERABLE)
return(PS_PROTOCOL);
@@ -51,6 +52,7 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id,
char buf [MSGBUFSIZE+1];
struct idlist *qnp; /* pointer to Q names */
+ (void)id;
if ((ok = SMTP_ehlo(sock, SMTP_MODE, fetchmailhost,
ctl->server.esmtp_name, ctl->server.esmtp_password,
&opts)))
diff --git a/opie.c b/opie.c
index 6c2018e4..b7687d94 100644
--- a/opie.c
+++ b/opie.c
@@ -73,7 +73,7 @@ int do_otp(int sock, char *command, struct query *ctl)
return rval;
return PS_SUCCESS;
-};
+}
#endif /* OPIE_ENABLE */
/* opie.c ends here */
diff --git a/options.c b/options.c
index 8a7c5a35..8f890ed0 100644
--- a/options.c
+++ b/options.c
@@ -49,7 +49,7 @@ enum {
LA_FETCHSIZELIMIT,
LA_FASTUIDL,
LA_LIMITFLUSH,
- LA_IDLE,
+ LA_IDLE
};
/* options still left: CgGhHjJoORTWxXYz */
diff --git a/pop2.c b/pop2.c
index 746419db..b8dbb09f 100644
--- a/pop2.c
+++ b/pop2.c
@@ -59,6 +59,7 @@ static int pop2_getauth(int sock, struct query *ctl, char *buf)
{
int status;
+ (void)buf;
strlcpy(shroud, ctl->password, sizeof(shroud));
status = gen_transact(sock,
"HELO %s %s",
@@ -71,6 +72,8 @@ static int pop2_getrange(int sock, struct query *ctl, const char *folder,
int *countp, int *newp, int *bytes)
/* get range of messages to be fetched */
{
+ (void)ctl;
+
/* maybe the user wanted a non-default folder */
if (folder)
{
@@ -106,6 +109,7 @@ static int pop2_fetch(int sock, struct query *ctl, int number, int *lenp)
{
int ok;
+ (void)ctl;
*lenp = 0;
ok = gen_transact(sock, "READ %d", number);
if (ok)
@@ -117,15 +121,18 @@ static int pop2_fetch(int sock, struct query *ctl, int number, int *lenp)
return(ok);
}
-static int pop2_trail(int sock, struct query *ctl, int number, const char *tag)
+static int pop2_trail(int sock, struct query *ctl, const char *tag)
/* send acknowledgement for message data */
{
+ (void)ctl;
+ (void)tag;
return(gen_transact(sock, ctl->keep ? "ACKS" : "ACKD"));
}
static int pop2_logout(int sock, struct query *ctl)
/* send logout command */
{
+ (void)ctl;
return(gen_transact(sock, "QUIT"));
}
@@ -147,8 +154,9 @@ static const struct method pop2 =
pop2_trail, /* eat message trailer */
NULL, /* no POP2 delete method */
NULL, /* how to mark a message as seen */
+ NULL, /* how to end mailbox processing */
pop2_logout, /* log out, we're done */
- FALSE, /* no, we can't re-poll */
+ FALSE /* no, we can't re-poll */
};
int doPOP2 (struct query *ctl)
diff --git a/pop3.c b/pop3.c
index 9fa37ba0..ff68f614 100644
--- a/pop3.c
+++ b/pop3.c
@@ -706,7 +706,7 @@ static int pop3_getuidl(int sock, int num, char *id /** output */, size_t idsize
return(ok);
if ((ok = parseuid(buf, &gotnum, id, idsize)))
return ok;
- if (gotnum != num) {
+ if (gotnum != (unsigned long)num) {
report(stderr, GT_("Server responded with UID for wrong message.\n"));
return PS_PROTOCOL;
}
@@ -869,6 +869,7 @@ static int pop3_getrange(int sock,
int ok;
char buf [POPBUFSIZE+1];
+ (void)folder;
/* Ensure that the new list is properly empty */
ctl->newsaved = (struct idlist *)NULL;
@@ -1012,15 +1013,15 @@ static int pop3_getrange(int sock,
static int pop3_getpartialsizes(int sock, int first, int last, int *sizes)
/* capture the size of message #first */
{
- int ok = 0, i;
+ int ok = 0, i, num;
char buf [POPBUFSIZE+1];
- unsigned int num, size;
+ unsigned int size;
for (i = first; i <= last; i++) {
gen_send(sock, "LIST %d", i);
if ((ok = pop3_ok(sock, buf)) != 0)
return(ok);
- if (sscanf(buf, "%u %u", &num, &size) == 2) {
+ if (sscanf(buf, "%d %u", &num, &size) == 2) {
if (num == i)
sizes[i - first] = size;
else
@@ -1052,7 +1053,7 @@ static int pop3_getsizes(int sock, int count, int *sizes)
if (DOTLINE(buf))
break;
else if (sscanf(buf, "%u %u", &num, &size) == 2) {
- if (num > 0 && num <= count)
+ if (num > 0 && num <= (unsigned)count)
sizes[num - 1] = size;
else
/* warn about possible attempt to induce buffer overrun */
@@ -1247,6 +1248,7 @@ static int pop3_delete(int sock, struct query *ctl, int number)
static int pop3_mark_seen(int sock, struct query *ctl, int number)
/* mark a given message as seen */
{
+ (void)sock;
mark_uid_seen(ctl, number);
return(PS_SUCCESS);
}
diff --git a/rcfile_l.l b/rcfile_l.l
index 506e8e20..9f4bf5c8 100644
--- a/rcfile_l.l
+++ b/rcfile_l.l
@@ -53,7 +53,7 @@ int prc_lineno = 1;
static char *in;
static size_t ins;
- if (yyleng + 1 > ins) {
+ if ((size_t)yyleng + 1 > ins) {
ins = yyleng + 1;
in = xrealloc(in, ins);
}
diff --git a/rpa.c b/rpa.c
index ccc7d509..79e4d8ab 100644
--- a/rpa.c
+++ b/rpa.c
@@ -419,10 +419,12 @@ int socket;
globals: none
*********************************************************************/
-static void LenAppend(pptr,len)
-char **pptr;
+static void LenAppend(pptr_,len)
+char **pptr_;
int len;
{
+ unsigned char **pptr = (unsigned char **)pptr_;
+
if (len < 0x80)
{
**pptr = len; (*pptr)++;
diff --git a/sink.c b/sink.c
index 48a6f5e0..3ceb367f 100644
--- a/sink.c
+++ b/sink.c
@@ -1070,6 +1070,7 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg,
int length = 0, fromlen = 0, nameslen = 0;
char *names = NULL, *before, *after, *from = NULL;
+ (void)bad_addresses;
xfree(ctl->destaddr);
ctl->destaddr = xstrdup("localhost");
@@ -1468,7 +1469,7 @@ unrecov:
return(TRUE);
}
-int open_warning_by_mail(struct query *ctl, struct msgblk *msg)
+int open_warning_by_mail(struct query *ctl)
/* set up output sink for a mailed warning to calling user */
{
int good, bad;
diff --git a/smbencrypt.c b/smbencrypt.c
index 144911b3..a98c63dc 100644
--- a/smbencrypt.c
+++ b/smbencrypt.c
@@ -61,7 +61,8 @@ char *StrnCpy(char *dest,const char *src, size_t n)
size_t skip_multibyte_char(char c)
{
-return 0;
+ (void)c;
+ return 0;
}
diff --git a/strlcat.c b/strlcat.c
index 7b9673f9..fe3ec105 100644
--- a/strlcat.c
+++ b/strlcat.c
@@ -21,7 +21,7 @@
#include <assert.h>
#include <string.h>
-#if !HAVE_STRLCAT
+#ifndef HAVE_STRLCAT
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
diff --git a/strlcpy.c b/strlcpy.c
index 64d9c575..baf2c7a7 100644
--- a/strlcpy.c
+++ b/strlcpy.c
@@ -21,7 +21,7 @@
#include <assert.h>
#include <string.h>
-#if !HAVE_STRLCPY
+#ifndef HAVE_STRLCPY
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
diff --git a/unmime.c b/unmime.c
index f68e51fb..0af0e2c5 100644
--- a/unmime.c
+++ b/unmime.c
@@ -701,7 +701,7 @@ int main(int argc, char *argv[])
}
buf_p++;
- if ((buf_p - buffer) == BufSize) {
+ if ((unsigned)(buf_p - buffer) == BufSize) {
/* Buffer is full! Get more room. */
buffer = xrealloc(buffer, BufSize+BUFSIZE_INCREMENT);
buf_p = buffer + BufSize;