]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Static Code Analysis: varargs cleanup, improvements to readability
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 16 Oct 2012 23:40:01 +0000 (17:40 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 16 Oct 2012 23:40:01 +0000 (17:40 -0600)
src/cache_cf.cc
src/ftp.cc
src/snmp_core.cc
src/stmem.cc
src/url.cc

index b8cb6c8325a4c6a80df25c8a8ace695a41dc7ba7..c92025c6dad822607c70a92a2fb29fd4c766c882 100644 (file)
@@ -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) {
index ec3fca075c227269d7a9f55912b6df5c3f7c3938..878cb7e4d9d2bd902bd803d7177cf306094c38fa 100644 (file)
@@ -3774,6 +3774,7 @@ FtpStateData::printfReplyBody(const char *fmt, ...)
     buf[0] = '\0';
     vsnprintf(buf, 4096, fmt, args);
     writeReplyBody(buf, strlen(buf));
+    va_end(args);
 }
 
 /**
index 4c9d45b6ccfeabb748e584324035aaffe7e87f06..7ac54ddd370ddf9f0a1e1b17a2f5aac71db746d8 100644 (file)
@@ -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);
 }
 
index 8a5c4fc8cbc69cb89b38ba9ebe64b87ebef8f0bb..1465a9fbe770a1777227767bd3eb37d972404857 100644 (file)
@@ -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<mem_node*> const * theStart = nodes.start();
+    SplayNode<mem_node*> const * theStart;
 
     while ((theStart = nodes.start())) {
         if (theStart == nodes.finish())
index 5377b1f48254cc3ddb7a912409702e140be1d0f5..760a887ddb89c5c532227ed3b5df9ca450024c34 100644 (file)
@@ -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;