From: Francesco Chemolli Date: Wed, 10 Oct 2012 17:06:38 +0000 (+0200) Subject: Static Code Analysis: varargs cleanup, improvements to readability X-Git-Tag: SQUID_3_4_0_1~579 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=810635e3511eaee543b04dedab8f56277d3db3a3;p=thirdparty%2Fsquid.git Static Code Analysis: varargs cleanup, improvements to readability --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index b8cb6c8325..c92025c6da 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -3665,7 +3665,7 @@ parse_port_option(AnyP::PortCfg * s, char *token) if (t) { ++t; s->tcp_keepalive.timeout = atoi(t); - t = strchr(t, ','); + // t = strchr(t, ','); // not really needed, left in as documentation } #if USE_SSL } else if (strcasecmp(token, "sslBump") == 0) { diff --git a/src/ftp.cc b/src/ftp.cc index ec3fca075c..878cb7e4d9 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -3774,6 +3774,7 @@ FtpStateData::printfReplyBody(const char *fmt, ...) buf[0] = '\0'; vsnprintf(buf, 4096, fmt, args); writeReplyBody(buf, strlen(buf)); + va_end(args); } /** diff --git a/src/stmem.cc b/src/stmem.cc index 8a5c4fc8cb..1465a9fbe7 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -104,8 +104,7 @@ int64_t mem_hdr::freeDataUpto(int64_t target_offset) { /* keep the last one to avoid change to other part of code */ - - SplayNode const * theStart = nodes.start(); + SplayNode const * theStart; while ((theStart = nodes.start())) { if (theStart == nodes.finish()) diff --git a/src/url.cc b/src/url.cc index 5377b1f482..760a887ddb 100644 --- a/src/url.cc +++ b/src/url.cc @@ -311,7 +311,8 @@ urlParse(const HttpRequestMethod& method, char *url, HttpRequest *request) port = urlDefaultPort(protocol); /* Is there any login information? (we should eventually parse it above) */ - if ((t = strrchr(host, '@'))) { + t = strrchr(host, '@'); + if (t != NULL) { strcpy((char *) login, (char *) host); t = strrchr(login, '@'); *t = 0;