From 3c25e877da7ba4a11e0c9bd5f65f8857cb8f272b Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 18 Jun 2004 19:51:39 +0000 Subject: Fix various compiler warnings. svn path=/trunk/; revision=3899 --- rfc822.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'rfc822.c') diff --git a/rfc822.c b/rfc822.c index 28dac71d..cd6fb17a 100644 --- a/rfc822.c +++ b/rfc822.c @@ -24,10 +24,12 @@ MIT license. Compile with -DMAIN to build the demonstrator. #include #include -#ifndef MAIN #include "fetchmail.h" + +#ifndef MAIN #include "i18n.h" #else +#include 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 */ -- cgit v1.2.3