]> Pileus Git - ~andy/fetchmail/commitdiff
Remove unused assignments/initializations found with llvm-clang.
authorMatthias Andree <matthias.andree@gmx.de>
Sun, 28 Feb 2010 12:53:28 +0000 (13:53 +0100)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 28 Feb 2010 13:11:19 +0000 (14:11 +0100)
daemon.c
driver.c
env.c
gssapi.c
pop3.c
rfc2047e.c
sink.c
socket.c
transact.c
ucs/norm_charmap.c

index cd60725fb840aefef2209ff01bc6bfdd23a90b36..43230265d2272903bc3074246f59069b6a1dd824 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -61,7 +61,7 @@ sigchld_handler (int sig)
 #if    defined(HAVE_WAITPID)                           /* the POSIX way */
     int status;
 
-    while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
+    while (waitpid(-1, &status, WNOHANG) > 0)
        continue; /* swallow 'em up. */
 #elif  defined(HAVE_WAIT3)                             /* the BSD way */
 #if defined(HAVE_UNION_WAIT) && !defined(__FreeBSD__)
@@ -208,7 +208,7 @@ nottyDetach:
   (void)close(0);
 
   /* Reopen stdin descriptor on /dev/null */
-  if ((fd = open("/dev/null", O_RDWR)) < 0) {   /* stdin */
+  if (open("/dev/null", O_RDWR) < 0) {   /* stdin */
     report(stderr, "cannot open /dev/null: %s\n", strerror(errno));
     return(PS_IOERR);
   }
index 8a43399a67c6c127a7a42b7c080d31f13c5f7b05..7785b89cf337586087ec26e9d85616c0e4c190cd 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -1518,7 +1518,6 @@ is restored."));
        smtp_close(ctl, 0);
        if (mailserver_socket != -1) {
            cleanupSockClose(mailserver_socket);
-           mailserver_socket = -1;
        }
        /* If there was a connect timeout, the socket should be closed.
         * mailserver_socket_temp contains the socket to close.
diff --git a/env.c b/env.c
index eabc2f41e8baf36294b6dd6d8db5cc8d3906bb8a..2ac5a6222c30349a51b6aee26e7abdbd41ebc526 100644 (file)
--- a/env.c
+++ b/env.c
@@ -318,7 +318,7 @@ char *visbuf(const char *buf)
            buf++;
        }
     }
-    *tp++ = '\0';
+    *tp = '\0';
     return(vbuf);
 }
 /* env.c ends here */
index 1b294bab1f71d5133a74c1c2618f086dc988a15f..8189552ab37ab7b4c4cdae525eaa93dfa90d36a5 100644 (file)
--- a/gssapi.c
+++ b/gssapi.c
@@ -67,11 +67,10 @@ int do_gssauth(int sock, char *command, char *service, char *hostname, char *use
         return PS_AUTHFAIL;
     }
     else if (outlevel >= O_DEBUG) {
-        maj_stat = gss_display_name(&min_stat, target_name, &request_buf,
-            &mech_name);
+        gss_display_name(&min_stat, target_name, &request_buf, &mech_name);
         report(stderr, GT_("Using service name [%s]\n"),
               (char *)request_buf.value);
-        maj_stat = gss_release_buffer(&min_stat, &request_buf);
+        gss_release_buffer(&min_stat, &request_buf);
     }
 
     gen_send(sock, "%s GSSAPI", command);
diff --git a/pop3.c b/pop3.c
index 7e7757d2368f17fa44126a40960f8407340f2733..70a91dd58e9319322c6c5d4e50ae55571b9e4b41 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -774,7 +774,7 @@ static int pop3_gettopid(int sock, int num , char *id, size_t idsize)
     if ((ok = gen_transact(sock, "%s", buf)) != 0)
        return ok;
     got_it = 0;
-    while ((ok = gen_recv(sock, buf, sizeof(buf))) == 0) 
+    while (gen_recv(sock, buf, sizeof(buf)) == 0)
     {
        if (DOTLINE(buf))
            break;
@@ -1065,10 +1065,10 @@ static int pop3_getrange(int sock,
            if (dofastuidl)
                return(pop3_fastuidl( sock, ctl, *countp, newp));
            /* grab the mailbox's UID list */
-           if ((ok = gen_transact(sock, "UIDL")) != 0)
+           if (gen_transact(sock, "UIDL") != 0)
            {
                /* don't worry, yet! do it the slow way */
-               if ((ok = pop3_slowuidl(sock, ctl, countp, newp)))
+               if (pop3_slowuidl(sock, ctl, countp, newp))
                {
                    report(stderr, GT_("protocol error while fetching UIDLs\n"));
                    return(PS_ERROR);
@@ -1080,7 +1080,7 @@ static int pop3_getrange(int sock,
                unsigned long unum;
 
                *newp = 0;
-               while ((ok = gen_recv(sock, buf, sizeof(buf))) == PS_SUCCESS)
+               while (gen_recv(sock, buf, sizeof(buf)) == PS_SUCCESS)
                {
                    if (DOTLINE(buf))
                        break;
index 87c9c5c557f6fc0183285b75489e10b9d1ae7f7b..28777a300d5aa7d49f8bdfdd6127a60a8fc2c6cb 100644 (file)
@@ -174,7 +174,7 @@ char *rfc2047e(const char *string, const char *charset) {
        if (i + 1 < count)
            m += strcspn(words[i+1], "\r\n");
        if (l + m > 74)
-           l = 0, t = stpcpy(t, "\r\n");
+           t = stpcpy(t, "\r\n");
        t = stpcpy(t, words[i]);
        if (i + 1 < count) {
            t = stpcpy(t, words[i+1]);
diff --git a/sink.c b/sink.c
index 675c2b9581f0d91dd590b38cba79ade5a58b2952..f4fbf4fd8837821d114fd520c2b41fcaaee038ec 100644 (file)
--- a/sink.c
+++ b/sink.c
@@ -114,7 +114,7 @@ int smtp_setup(struct query *ctl)
         */
        struct idlist   *idp;
        const char *id_me = run.invisible ? ctl->server.truename : fetchmailhost;
-       int oldphase = phase;
+       int oldphase;
        char *parsed_host = NULL;
 
        errno = 0;
index c245b3d4c55c12a7291feaafecae050b8a94b202..adc4f585866a61f8859e52a1ed060900fdfc9130 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -462,7 +462,7 @@ int SockRead(int sock, char *buf, int len)
                        /* SSL_peek says no data...  Does he mean no data
                        or did the connection blow up?  If we got an error
                        then bail! */
-                       if( 0 != ( n = SSL_get_error(ssl, n) ) ) {
+                       if (0 != SSL_get_error(ssl, n)) {
                                return -1;
                        }
                        /* We didn't get an error so read at least one
@@ -542,7 +542,7 @@ int SockPeek(int sock)
                        /* SSL_peek says 0...  Does that mean no data
                        or did the connection blow up?  If we got an error
                        then bail! */
-                       if( 0 != ( n = SSL_get_error(ssl, n) ) ) {
+                       if(0 != SSL_get_error(ssl, n)) {
                                return -1;
                        }
 
index 857d7a3555ea370677df698fa8c1cd0b182d5ab9..85d8b009d958877c02d61d394c0f1f5ec48fc26a 100644 (file)
@@ -529,8 +529,8 @@ int readheaders(int sock,
                tcp = line + linelen - 1;
                *tcp++ = '\r';
                *tcp++ = '\n';
-               *tcp++ = '\0';
-               n++;
+               *tcp = '\0';
+               /* n++; - not used later on */
                linelen++;
            }
            else
@@ -1332,7 +1332,7 @@ process_headers:
     cp = buf;
     *cp++ = '\r';
     *cp++ = '\n';
-    *cp++ = '\0';
+    *cp = '\0';
     n = stuffline(ctl, buf);
 
     if ((size_t)n == strlen(buf))
index 2905e226295b2ec20f6d526032297b17b9601868..f00dcc26df8956f6e4dae3c4579cd7db2beffdc3 100644 (file)
@@ -84,7 +84,7 @@ const char *norm_charmap(const char *name)
     p += 5;
     if (digit(*p)) {
       buf[9] = *p++;
-      if (digit(*p)) buf[10] = *p++;
+      if (digit(*p)) buf[10] = *p;
       return buf;
     }
   }
@@ -95,7 +95,7 @@ const char *norm_charmap(const char *name)
     p += 4;
     if (digit(*p)) {
       buf[10] = *p++;
-      if (digit(*p)) buf[11] = *p++;
+      if (digit(*p)) buf[11] = *p;
       return buf;
     }
   }