aboutsummaryrefslogtreecommitdiff
path: root/src/tool_cb_dbg.c
diff options
context:
space:
mode:
authorMarian Klymov <nekto1989@gmail.com>2018-06-02 23:52:56 +0300
committerDaniel Stenberg <daniel@haxx.se>2018-06-11 11:14:48 +0200
commitc45360d4633850839bb9c2d77dbf8a8285e9ad49 (patch)
tree20159c553a74ed98c2431fc8f2852067f79ac4e9 /src/tool_cb_dbg.c
parent38203f1585da53e07e54e37c7d5da4d72f509a2e (diff)
cppcheck: fix warnings
- Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
Diffstat (limited to 'src/tool_cb_dbg.c')
-rw-r--r--src/tool_cb_dbg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c
index 16bfb4208..c2dd51b7c 100644
--- a/src/tool_cb_dbg.c
+++ b/src/tool_cb_dbg.c
@@ -50,15 +50,15 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
FILE *output = config->errors;
const char *text;
struct timeval tv;
- struct tm *now;
char timebuf[20];
time_t secs;
- static time_t epoch_offset;
- static int known_offset;
(void)handle; /* not used */
if(config->tracetime) {
+ struct tm *now;
+ static time_t epoch_offset;
+ static int known_offset;
tv = tvnow();
if(!known_offset) {
epoch_offset = time(NULL) - tv.tv_sec;
@@ -101,14 +101,14 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
static const char * const s_infotype[] = {
"*", "<", ">", "{", "}", "{", "}"
};
- size_t i;
- size_t st = 0;
static bool newl = FALSE;
static bool traced_data = FALSE;
switch(type) {
case CURLINFO_HEADER_OUT:
if(size > 0) {
+ size_t st = 0;
+ size_t i;
for(i = 0; i < size - 1; i++) {
if(data[i] == '\n') { /* LF */
if(!newl) {