diff options
-rw-r--r-- | base64.c | 1 | ||||
-rw-r--r-- | daemon.c | 2 | ||||
-rw-r--r-- | driver.c | 22 | ||||
-rw-r--r-- | env.c | 2 | ||||
-rw-r--r-- | imap.c | 2 | ||||
-rw-r--r-- | netrc.c | 5 | ||||
-rw-r--r-- | pop3.c | 2 | ||||
-rw-r--r-- | rfc822.c | 21 | ||||
-rw-r--r-- | socket.c | 8 | ||||
-rw-r--r-- | transact.c | 14 | ||||
-rw-r--r-- | uid.c | 2 | ||||
-rw-r--r-- | unmime.c | 2 |
12 files changed, 42 insertions, 41 deletions
@@ -8,6 +8,7 @@ * scheme used here. */ #include "config.h" +#include "fetchmail.h" #include <ctype.h> static const char base64digits[] = @@ -53,7 +53,7 @@ #include "fetchmail.h" #include "tunable.h" -RETSIGTYPE +static RETSIGTYPE sigchld_handler (int sig) /* process SIGCHLD to obtain the exit code of the terminating process */ { @@ -815,24 +815,25 @@ flagthemail: return(PS_SUCCESS); } -static int do_session(ctl, proto, maxfetch) /* retrieve messages from server using given protocol method table */ -struct query *ctl; /* parsed options with merged-in defaults */ -const struct method *proto; /* protocol method table */ -const int maxfetch; /* maximum number of messages to fetch */ +static int do_session( + /* parsed options with merged-in defaults */ + struct query *ctl, + /* protocol method table */ + const struct method *proto, + /* maximum number of messages to fetch */ + const int maxfetch) { - int js; -#ifdef HAVE_VOLATILE + static int *msgsizes; volatile int err, mailserver_socket = -1; /* pacifies -Wall */ -#else - int err, mailserver_socket = -1; -#endif /* HAVE_VOLATILE */ + int deletions = 0, js; const char *msg; SIGHANDLERTYPE pipesave; SIGHANDLERTYPE alrmsave; ctl->server.base_protocol = proto; + msgsizes = NULL; pass = 0; err = 0; init_transact(proto); @@ -924,8 +925,7 @@ const int maxfetch; /* maximum number of messages to fetch */ else { char buf[MSGBUFSIZE+1], *realhost; - int count, new, bytes, deletions = 0; - int *msgsizes = (int *)NULL; + int count, new, bytes; #if INET6_ENABLE int fetches, dispatches, oldphase; #else /* INET6_ENABLE */ @@ -30,7 +30,7 @@ #include <locale.h> #endif -extern char *getenv(); /* needed on sysV68 R3V7.1. */ +extern char *getenv(const char *); /* needed on sysV68 R3V7.1. */ extern char *program_name; @@ -23,7 +23,7 @@ #endif /* OPIE_ENABLE */ #ifndef strstr /* glibc-2.1 declares this as a macro */ -extern char *strstr(); /* needed on sysV68 R3V7.1. */ +extern char *strstr(const char *, const char *); /* needed on sysV68 R3V7.1. */ #endif /* strstr */ /* imap_version values */ @@ -320,10 +320,7 @@ search_netrc (list, host, login) #include <errno.h> -int -main (argc, argv) - int argc; - char **argv; +int main (int argc, char **argv) { struct stat sb; char *program_name, *file, *host, *login; @@ -26,7 +26,7 @@ #endif /* OPIE_ENABLE */ #ifndef strstr /* glibc-2.1 declares this as a macro */ -extern char *strstr(); /* needed on sysV68 R3V7.1. */ +extern char *strstr(const char *, const char *); /* needed on sysV68 R3V7.1. */ #endif /* strstr */ static int last; @@ -24,10 +24,12 @@ MIT license. Compile with -DMAIN to build the demonstrator. #include <string.h> #include <stdlib.h> -#ifndef MAIN #include "fetchmail.h" + +#ifndef MAIN #include "i18n.h" #else +#include <unistd.h> static int verbose; char *program_name = "rfc822"; #endif /* MAIN */ @@ -39,11 +41,11 @@ char *program_name = "rfc822"; #define HEADER_END(p) ((p)[0] == '\n' && ((p)[1] != ' ' && (p)[1] != '\t')) -unsigned char *reply_hack(buf, host, length) +unsigned char *reply_hack( + unsigned char *buf /* header to be hacked */, + const unsigned char *host /* server hostname */, + int *length) /* hack message headers so replies will work properly */ -unsigned char *buf; /* header to be hacked */ -const unsigned char *host; /* server hostname */ -int *length; { unsigned char *from, *cp, last_nws = '\0', *parens_from = NULL; int parendepth, state, has_bare_name_part, has_host_part; @@ -213,9 +215,8 @@ int *length; return(buf); } -unsigned char *nxtaddr(hdr) +unsigned char *nxtaddr(const unsigned char *hdr /* header to be parsed, NUL to continue previous hdr */) /* parse addresses in succession out of a specified RFC822 header */ -const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr */ { static unsigned char address[BUFSIZ]; static int tp; @@ -392,10 +393,11 @@ const unsigned char *hdr; /* header to be parsed, NUL to continue previous hdr * static void parsebuf(unsigned char *longbuf, int reply) { unsigned char *cp; + int dummy; if (reply) { - reply_hack(longbuf, "HOSTNAME.NET"); + reply_hack(longbuf, "HOSTNAME.NET", &dummy); printf("Rewritten buffer: %s", longbuf); } else @@ -408,7 +410,7 @@ static void parsebuf(unsigned char *longbuf, int reply) -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { unsigned char buf[BUFSIZ], longbuf[BUFSIZ]; int ch, reply; @@ -450,6 +452,7 @@ main(int argc, char *argv[]) fputs(longbuf, stdout); parsebuf(longbuf, reply); } + exit(0); } #endif /* MAIN */ @@ -80,7 +80,7 @@ extern int mailserver_socket_temp; /* Socket to close if connect timeout */ #endif /* NET_SECURITY */ #ifdef HAVE_SOCKETPAIR -char *const *parse_plugin(const char *plugin, const char *host, const char *service) +static char *const *parse_plugin(const char *plugin, const char *host, const char *service) { const char **argvec; const char *c, *p; char *cp, *plugin_copy; @@ -752,7 +752,7 @@ SSL *SSLGetContext( int sock ) } -int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict ) +static int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict ) { char buf[257]; X509 *x509_cert; @@ -884,12 +884,12 @@ int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict ) return (ok_return); } -int SSL_nock_verify_callback( int ok_return, X509_STORE_CTX *ctx ) +static int SSL_nock_verify_callback( int ok_return, X509_STORE_CTX *ctx ) { return SSL_verify_callback(ok_return, ctx, 0); } -int SSL_ck_verify_callback( int ok_return, X509_STORE_CTX *ctx ) +static int SSL_ck_verify_callback( int ok_return, X509_STORE_CTX *ctx ) { return SSL_verify_callback(ok_return, ctx, 1); } @@ -36,7 +36,7 @@ #include "fetchmail.h" #ifndef strstr /* glibc-2.1 declares this as a macro */ -extern char *strstr(); /* needed on sysV68 R3V7.1. */ +extern char *strstr(const char *, const char *); /* needed on sysV68 R3V7.1. */ #endif /* strstr */ int mytimeout; /* value of nonreponse timeout */ @@ -87,7 +87,7 @@ static void find_server_names(const char *hdr, { char *cp; - for (cp = nxtaddr(hdr); + for (cp = nxtaddr((const unsigned char *)hdr); cp != NULL; cp = nxtaddr(NULL)) { @@ -110,11 +110,11 @@ static void find_server_names(const char *hdr, { int sl = strlen(ctl->server.qvirtual); - if (!strncasecmp(cp, ctl->server.qvirtual, sl)) + if (!strncasecmp((char *)cp, ctl->server.qvirtual, sl)) cp += sl; } - if ((atsign = strchr(cp, '@'))) { + if ((atsign = strchr((char *)cp, '@'))) { struct idlist *idp; /* @@ -125,15 +125,15 @@ static void find_server_names(const char *hdr, for (idp = ctl->server.localdomains; idp; idp = idp->next) { char *rhs; - rhs = atsign + (strlen(atsign) - strlen(idp->id)); + rhs = atsign + (strlen(atsign) - strlen((char *)idp->id)); if (rhs > atsign && (rhs[-1] == '.' || rhs[-1] == '@') && - strcasecmp(rhs, idp->id) == 0) + strcasecmp(rhs, (char *)idp->id) == 0) { if (outlevel >= O_DEBUG) report(stdout, GT_("passed through %s matching %s\n"), cp, idp->id); - save_str(xmit_names, cp, XMIT_ACCEPT); + save_str(xmit_names, (const char *)cp, XMIT_ACCEPT); accept_count++; goto nomap; } @@ -271,7 +271,7 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile) /* return a pointer to the last element of the list to help the quick, * constant-time addition to the list, NOTE: this function does not dup * the string, the caller must do that. */ -/*@shared@*/ struct idlist **save_str_quick(/*@shared@*/ struct idlist **idl, +/*@shared@*/ static struct idlist **save_str_quick(/*@shared@*/ struct idlist **idl, /*@only@*/ char *str, flag status) /* save a number/UID pair on the given UID list */ { @@ -327,7 +327,7 @@ static char *GetBoundary(char *CntType) } -int CheckContentType(char *CntType) +static int CheckContentType(char *CntType) { /* * Static array of Content-Type's for which we will do |