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
This commit is contained in:
Marian Klymov 2018-06-02 23:52:56 +03:00 committed by Daniel Stenberg
parent 38203f1585
commit c45360d463
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
61 changed files with 213 additions and 273 deletions

View file

@ -622,12 +622,12 @@ CURLcode glob_match_url(char **result, char *filename, URLGlob *glob)
while(*filename) {
if(*filename == '#' && ISDIGIT(filename[1])) {
unsigned long i;
char *ptr = filename;
unsigned long num = strtoul(&filename[1], &filename, 10);
URLPattern *pat = NULL;
if(num < glob->size) {
unsigned long i;
num--; /* make it zero based */
/* find the correct glob entry */
for(i = 0; i<glob->size; i++) {