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 807c49a  cppcheck: fixes issues found for plugins/background_fetch
807c49a is described below

commit 807c49a82ed08b78c24d9d1a0d56897756ebace7
Author: Jan van Doorn <[email protected]>
AuthorDate: Wed Apr 24 09:58:41 2019 +0800

    cppcheck: fixes issues found for plugins/background_fetch
---
 plugins/background_fetch/configs.cc | 2 +-
 plugins/background_fetch/headers.cc | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/background_fetch/configs.cc 
b/plugins/background_fetch/configs.cc
index 96fd251..479317b 100644
--- a/plugins/background_fetch/configs.cc
+++ b/plugins/background_fetch/configs.cc
@@ -127,9 +127,9 @@ BgFetchConfig::readConfig(const char *config_file)
       char *cfg_type  = strtok_r(buffer, " ", &savePtr);
       char *cfg_name  = nullptr;
       char *cfg_value = nullptr;
-      bool exclude    = false;
 
       if (cfg_type) {
+        bool exclude = false;
         if (!strcmp(cfg_type, "exclude")) {
           exclude = true;
         } else if (strcmp(cfg_type, "include")) {
diff --git a/plugins/background_fetch/headers.cc 
b/plugins/background_fetch/headers.cc
index 4043993..4317d9d 100644
--- a/plugins/background_fetch/headers.cc
+++ b/plugins/background_fetch/headers.cc
@@ -100,7 +100,6 @@ dump_headers(TSMBuffer bufp, TSMLoc hdr_loc)
   TSIOBuffer output_buffer;
   TSIOBufferReader reader;
   TSIOBufferBlock block;
-  const char *block_start;
   int64_t block_avail;
 
   output_buffer = TSIOBufferCreate();
@@ -112,7 +111,7 @@ dump_headers(TSMBuffer bufp, TSMLoc hdr_loc)
   /* We need to loop over all the buffer blocks, there can be more than 1 */
   block = TSIOBufferReaderStart(reader);
   do {
-    block_start = TSIOBufferBlockReadStart(block, reader, &block_avail);
+    const char *block_start = TSIOBufferBlockReadStart(block, reader, 
&block_avail);
     if (block_avail > 0) {
       TSDebug(PLUGIN_NAME, "Headers are:\n%.*s", 
static_cast<int>(block_avail), block_start);
     }

Reply via email to