From 944e10700c98f8ac71c2385fd96671167463fcf0 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 28 Feb 2010 13:53:28 +0100 Subject: Remove unused assignments/initializations found with llvm-clang. --- daemon.c | 4 ++-- driver.c | 1 - env.c | 2 +- gssapi.c | 5 ++--- pop3.c | 8 ++++---- rfc2047e.c | 2 +- sink.c | 2 +- socket.c | 4 ++-- transact.c | 6 +++--- ucs/norm_charmap.c | 4 ++-- 10 files changed, 18 insertions(+), 20 deletions(-) diff --git a/daemon.c b/daemon.c index cd60725f..43230265 100644 --- 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); } diff --git a/driver.c b/driver.c index 8a43399a..7785b89c 100644 --- 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 eabc2f41..2ac5a622 100644 --- 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 */ diff --git a/gssapi.c b/gssapi.c index 1b294bab..8189552a 100644 --- 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 7e7757d2..70a91dd5 100644 --- 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; diff --git a/rfc2047e.c b/rfc2047e.c index 87c9c5c5..28777a30 100644 --- a/rfc2047e.c +++ b/rfc2047e.c @@ -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 675c2b95..f4fbf4fd 100644 --- 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; diff --git a/socket.c b/socket.c index c245b3d4..adc4f585 100644 --- 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; } diff --git a/transact.c b/transact.c index 857d7a35..85d8b009 100644 --- a/transact.c +++ b/transact.c @@ -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)) diff --git a/ucs/norm_charmap.c b/ucs/norm_charmap.c index 2905e226..f00dcc26 100644 --- a/ucs/norm_charmap.c +++ b/ucs/norm_charmap.c @@ -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; } } -- cgit v1.2.3