diff options
author | Marian Klymov <nekto1989@gmail.com> | 2018-06-02 23:52:56 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-06-11 11:14:48 +0200 |
commit | c45360d4633850839bb9c2d77dbf8a8285e9ad49 (patch) | |
tree | 20159c553a74ed98c2431fc8f2852067f79ac4e9 /tests/server/sws.c | |
parent | 38203f1585da53e07e54e37c7d5da4d72f509a2e (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 'tests/server/sws.c')
-rw-r--r-- | tests/server/sws.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c index 22ef8168a..ec11224f5 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -555,7 +555,6 @@ static int ProcessRequest(struct httprequest *req) if(sscanf(req->reqbuf, "CONNECT %" MAXDOCNAMELEN_TXT "s HTTP/%d.%d", doc, &prot_major, &prot_minor) == 3) { char *portp = NULL; - unsigned long part = 0; snprintf(logbuf, sizeof(logbuf), "Received a CONNECT %s HTTP/%d.%d request", @@ -569,6 +568,7 @@ static int ProcessRequest(struct httprequest *req) if(doc[0] == '[') { char *p = &doc[1]; + unsigned long part = 0; /* scan through the hexgroups and store the value of the last group in the 'part' variable and use as test case number!! */ while(*p && (ISXDIGIT(*p) || (*p == ':') || (*p == '.'))) { @@ -954,7 +954,6 @@ static void init_httprequest(struct httprequest *req) is no data waiting, or < 0 if it should be closed */ static int get_request(curl_socket_t sock, struct httprequest *req) { - int error; int fail = 0; char *reqbuf = req->reqbuf; ssize_t got = 0; @@ -1000,7 +999,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req) fail = 1; } else if(got < 0) { - error = SOCKERRNO; + int error = SOCKERRNO; if(EAGAIN == error || EWOULDBLOCK == error) { /* nothing to read at the moment */ return 0; |