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

index bb37c0799ed4c5d73f070f3f8e631acf991d6331..cdb45ca56e426a980926eb6958d3973f1a8e484c 100644 (file)
@@ -3636,7 +3636,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 0658a8f90c66be5e5ab2b3b25bc068c45d42ff00..e0c1d37ec89ce356e8743907613dc718c0169344 100644 (file)
@@ -3768,6 +3768,7 @@ FtpStateData::printfReplyBody(const char *fmt, ...)
     buf[0] = '\0';
     vsnprintf(buf, 4096, fmt, args);
     writeReplyBody(buf, strlen(buf));
+    va_end(args);
 }
 
 /**
index d779b6732675e92ce9d0a2fd0330e12ed8afe0bf..691ac742995915e4b2b44e6b65ad6849db42e5d5 100644 (file)
@@ -1036,6 +1036,7 @@ snmpAddNode(oid * name, int len, oid_ParseFn * parsefunction, instance_Fn * inst
         }
     }
 
+    va_end(args);
     return (entry);
 }
 /* End of tree utility functions */
@@ -1059,6 +1060,7 @@ snmpCreateOid(int length,...)
         }
     }
 
+    va_end(args);
     return (new_oid);
 }
 
index 716c3097fac62a67b9e6da8f48b7fab20f04db8f..2708286f1cfcf16bd9a05d2d8c5921e820d2542e 100644 (file)
@@ -105,8 +105,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 5e6e1c23b9178bfc5e91984026ab490a3d7a77db..282fc5d73f647f8c137c7f7dad7391822743fd35 100644 (file)
@@ -310,7 +310,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;