aboutsummaryrefslogtreecommitdiff
path: root/src/tool_cb_prg.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_prg.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_prg.c')
-rw-r--r--src/tool_cb_prg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c
index 60a3804f9..3eb2c1255 100644
--- a/src/tool_cb_prg.c
+++ b/src/tool_cb_prg.c
@@ -113,12 +113,6 @@ int tool_progress_cb(void *clientp,
/* The original progress-bar source code was written for curl by Lars Aas,
and this new edition inherits some of his concepts. */
- char line[MAX_BARLENGTH + 1];
- char format[40];
- double frac;
- double percent;
- int barwidth;
- int num;
struct timeval now = tvnow();
struct ProgressData *bar = (struct ProgressData *)clientp;
curl_off_t total;
@@ -154,6 +148,12 @@ int tool_progress_cb(void *clientp,
bar->calls++;
if((total > 0) && (point != bar->prev)) {
+ char line[MAX_BARLENGTH + 1];
+ char format[40];
+ double frac;
+ double percent;
+ int barwidth;
+ int num;
if(point > total)
/* we have got more than the expected total! */
total = point;