You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2018/05/24 17:25:17 UTC

[trafficserver] branch master updated: Fixed clang-analyzer issue with dead increment in wccp

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 7179d6f  Fixed clang-analyzer issue with dead increment in wccp
7179d6f is described below

commit 7179d6fea9c2970613e64887d0501298059284de
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu May 24 09:14:11 2018 -0700

    Fixed clang-analyzer issue with dead increment in wccp
---
 lib/wccp/WccpStatic.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/wccp/WccpStatic.cc b/lib/wccp/WccpStatic.cc
index caec397..d689b79 100644
--- a/lib/wccp/WccpStatic.cc
+++ b/lib/wccp/WccpStatic.cc
@@ -169,16 +169,15 @@ vlogf_errno(ts::Errata::Code code, char const *format, va_list &rest)
 {
   int e = errno; // Preserve value before making system calls.
   ts::Errata err;
-  int n;
   static int const E_SIZE = 1024;
   char e_buffer[E_SIZE];
   static int const T_SIZE = 8192;
   char t_buffer[T_SIZE];
 
-  n = vsnprintf(t_buffer, T_SIZE, format, rest);
+  int n = vsnprintf(t_buffer, T_SIZE, format, rest);
   if (0 <= n && n < T_SIZE) { // still have room.
     ATS_UNUSED_RETURN(strerror_r(e, e_buffer, E_SIZE));
-    n += snprintf(t_buffer + n, T_SIZE - n, "[%d] %s", e, e_buffer);
+    snprintf(t_buffer + n, T_SIZE - n, "[%d] %s", e, e_buffer);
   }
   err.push(ts::Errata::Id(0), code, t_buffer);
   return err;

-- 
To stop receiving notification emails like this one, please contact
bcall@apache.org.