]> Pileus Git - ~andy/fetchmail/commitdiff
Fix various warnings.
authorMatthias Andree <matthias.andree@gmx.de>
Sat, 19 Jun 2004 01:51:38 +0000 (01:51 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Sat, 19 Jun 2004 01:51:38 +0000 (01:51 -0000)
svn path=/trunk/; revision=3904

imap.c
opie.c
pop2.c
pop3.c
rpa.c

diff --git a/imap.c b/imap.c
index f1b516ee837e833a790d5f6faa4112a3b868bb8a..af930b48940c40ef097997c7551c72d0271e5915 100644 (file)
--- a/imap.c
+++ b/imap.c
@@ -443,16 +443,17 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
 #ifdef OPIE_ENABLE
     if ((ctl->server.authenticate == A_ANY 
         || ctl->server.authenticate == A_OTP)
-       && strstr(capabilities, "AUTH=X-OTP"))
+       && strstr(capabilities, "AUTH=X-OTP")) {
        if ((ok = do_otp(sock, "AUTHENTICATE", ctl)))
        {
            /* SASL cancellation of authentication */
            gen_send(sock, "*");
            if(ctl->server.authenticate != A_ANY)
                 return ok;
-       }
-       else
+       } else {
            return ok;
+       }
+    }
 #else
     if (ctl->server.authenticate == A_OTP)
     {
diff --git a/opie.c b/opie.c
index e696e2093d6042bb5d2fb3b714786ff7c5d11741..3a23c5ef50a8cd82f6a6bea48f5d0d6b5b8af4da 100644 (file)
--- a/opie.c
+++ b/opie.c
@@ -30,7 +30,7 @@ int do_otp(int sock, char *command, struct query *ctl)
 
     gen_send(sock, "%s X-OTP", command);
 
-    if (rval = gen_recv(sock, buffer, sizeof(buffer)))
+    if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
        return rval;
 
        if (strncmp(buffer, "+", 1)) {
@@ -43,7 +43,7 @@ int do_otp(int sock, char *command, struct query *ctl)
     gen_send(sock, buffer, sizeof(buffer));
        suppress_tags = FALSE;
 
-    if (rval = gen_recv(sock, buffer, sizeof(buffer)))
+    if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
        return rval;
 
        memset(challenge, '\0', sizeof(challenge));
@@ -70,7 +70,7 @@ int do_otp(int sock, char *command, struct query *ctl)
     gen_send(sock, buffer, strlen(buffer));
     suppress_tags = FALSE;
 
-    if (rval = gen_recv(sock, buffer, sizeof(buffer)))
+    if ((rval = gen_recv(sock, buffer, sizeof(buffer))))
        return rval;
 
     if (result)
diff --git a/pop2.c b/pop2.c
index b6af74bc5a7a66fcebabc7b4652e97e58bae62a8..88ad42441830e71aa062617569d1538e1ce4514d 100644 (file)
--- a/pop2.c
+++ b/pop2.c
@@ -12,6 +12,9 @@
 #if defined(STDC_HEADERS)
 #include <stdlib.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
 #include  "fetchmail.h"
 #include  "socket.h"
 
@@ -61,6 +64,7 @@ static int pop2_getauth(int sock, struct query *ctl, char *buf)
                  "HELO %s %s",
                  ctl->remotename, ctl->password);
     shroud[0] = '\0';
+    return status;
 }
 
 static int pop2_getrange(int sock, struct query *ctl, const char *folder, 
@@ -125,7 +129,7 @@ static int pop2_logout(int sock, struct query *ctl)
     return(gen_transact(sock, "QUIT"));
 }
 
-const static struct method pop2 =
+static const struct method pop2 =
 {
     "POP2",                            /* Post Office Protocol v2 */
 #if INET6_ENABLE
diff --git a/pop3.c b/pop3.c
index 1a74715a842aa61cc780807011f06b901ed705f4..230244d69842696eca4a8bf61d7e790f44d14402 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -490,7 +490,7 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting)
 
 #ifdef OPIE_ENABLE
        /* see RFC1938: A One-Time Password System */
-       if (challenge = strstr(lastok, "otp-")) {
+       if ((challenge = strstr(lastok, "otp-"))) {
          char response[OPIE_RESPONSE_MAX+1];
          int i;
 
diff --git a/rpa.c b/rpa.c
index 5a2cfb46b495a144c4d58ef4de107ca0aca810e8..7a3cae8a5ddd638eb16a195f7d2021884cf48cb8 100644 (file)
--- a/rpa.c
+++ b/rpa.c
 
 #if defined(POP3_ENABLE) && defined(RPA_ENABLE)
 #include  <stdio.h>
+#include  <stdlib.h>
 #include  <unistd.h>
 #include  <ctype.h>
-#include  <string.h> 
+#include  <string.h>
 
 #include  "socket.h"
 #include  "fetchmail.h"
@@ -281,11 +282,13 @@ int POP3_auth_rpa (unsigned char *userid, unsigned char *passphrase, int socket)
     }
     if (status != 0)
     {
-       if (outlevel > O_SILENT)
-           if (status < 4)
+       if (outlevel > O_SILENT) {
+           if (status < 4) {
                report(stderr, GT_("RPA rejects you: %s\n"),GT_(stdec[status]));
-           else
+           } else {
                report(stderr, GT_("RPA rejects you, reason unknown\n"));
+           }
+       }
        return(PS_AUTHFAIL);
     }
     if (Aul != aulin)
@@ -625,12 +628,9 @@ int  len;
   globals:       reads outlevel;
  *********************************************************************/
 
-static void ToUnicode(pptr,delim,buf,plen,conv)
-unsigned char **pptr; /* input string  */
-unsigned char delim;
-unsigned char *buf;   /* output buffer */
-int  *plen;
-int conv;
+static void ToUnicode(unsigned char **pptr /* input string*/,
+       unsigned char delim, unsigned char *buf /* output buffer */,
+       int *plen, int conv)
 {
     unsigned char *p;
     int i;
@@ -676,8 +676,7 @@ int conv;
                  writes Ns Nsl Nr Nrl
  *********************************************************************/
 
-static int SetRealmService(bufp)
-unsigned char* bufp;
+static int SetRealmService(unsigned char *bufp)
 {
     /* For the moment we pick the first available realm. It would */
     /* make more sense to verify that the realm which the user    */
@@ -705,9 +704,7 @@ unsigned char* bufp;
                  reads /dev/random
  *********************************************************************/
 
-static void GenChallenge(buf,len)
-unsigned char *buf;
-int  len;
+static void GenChallenge(unsigned char *buf, int len)
 {
     int  i;
     FILE *devrandom;
@@ -756,10 +753,8 @@ int  len;
                  writes Pu.
  *********************************************************************/
 
-static int DigestPassphrase(passphrase,rbuf,unicodeit)
-unsigned char *passphrase;
-unsigned char *rbuf;
-int unicodeit;
+static int DigestPassphrase(unsigned char *passphrase,unsigned char *rbuf,
+       int unicodeit)
 {
     int   len;
     unsigned char  workarea[STRMAX];
@@ -795,7 +790,7 @@ int unicodeit;
                  writes Ru.
  *********************************************************************/
 
-static void CompUserResp()
+static void CompUserResp(void)
 {
     unsigned char  workarea[Pul+48+STRMAX*5+Tsl+Pul];
     unsigned char* p;
@@ -827,7 +822,7 @@ static void CompUserResp()
                  writes Ru.
  *********************************************************************/
 
-static int CheckUserAuth()
+static int CheckUserAuth(void)
 {
     unsigned char  workarea[Pul+48+STRMAX*7+Tsl+Pul];
     unsigned char* p;
@@ -878,10 +873,7 @@ static int CheckUserAuth()
   globals:       reads outlevel
  *********************************************************************/
 
-static void md5(in,len,out)
-unsigned char*    in;
-int      len;
-unsigned char*    out;
+static void md5(unsigned char *in,int len,unsigned char *out)
 {
     int      i;
     MD5_CTX  md5context;