From: Francesco Chemolli Date: Tue, 16 Oct 2012 23:40:01 +0000 (-0600) Subject: Static Code Analysis: varargs cleanup, improvements to readability X-Git-Tag: SQUID_3_3_0_1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1521a3d598a90569be184218830f8984e70030e0;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/snmp_core.cc b/src/snmp_core.cc index 4c9d45b6cc..7ac54ddd37 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1039,6 +1039,7 @@ snmpAddNode(oid * name, int len, oid_ParseFn * parsefunction, instance_Fn * inst } } + va_end(args); return (entry); } /* End of tree utility functions */ @@ -1062,6 +1063,7 @@ snmpCreateOid(int length,...) } } + va_end(args); return (new_oid); } 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;