summaryrefslogtreecommitdiff
path: root/lib/url.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 /lib/url.c
parent38203f1585da53e07e54e37c7d5da4d72f509a2e (diff)
downloadcurl-c45360d4633850839bb9c2d77dbf8a8285e9ad49.tar.gz
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 'lib/url.c')
-rw-r--r--lib/url.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/url.c b/lib/url.c
index 61022d5c0..817baaa08 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2003,7 +2003,6 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
char *fragment;
char *path = data->state.path;
char *query;
- int i;
int rc;
const char *protop = "";
CURLcode result;
@@ -2055,6 +2054,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
; /* do nothing */
}
else { /* check for a scheme */
+ int i;
for(i = 0; i < 16 && data->change.url[i]; ++i) {
if(data->change.url[i] == '/')
break;
@@ -2543,14 +2543,13 @@ static bool check_noproxy(const char *name, const char *no_proxy)
* not be proxied, or an asterisk to override
* all proxy variables)
*/
- size_t tok_start;
- size_t tok_end;
- const char *separator = ", ";
- size_t no_proxy_len;
- size_t namelen;
- char *endptr;
-
if(no_proxy && no_proxy[0]) {
+ size_t tok_start;
+ size_t tok_end;
+ const char *separator = ", ";
+ size_t no_proxy_len;
+ size_t namelen;
+ char *endptr;
if(strcasecompare("*", no_proxy)) {
return TRUE;
}