aboutsummaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-25 10:06:08 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-06-05 20:38:06 +0200
commite23c52b3295a525fbaae9e7ed3e7061fea6dffc2 (patch)
tree4a74cf5ed3496a6126f1cc7c4284b6620108db06 /tests/server
parent04ac54e1965041684fc1b6532eba90f58601264e (diff)
build: fix Codacy warnings
Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/socksd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/server/socksd.c b/tests/server/socksd.c
index df32a49a1..5e32bc904 100644
--- a/tests/server/socksd.c
+++ b/tests/server/socksd.c
@@ -749,10 +749,6 @@ static bool incoming(curl_socket_t listenfd)
fd_set fds_read;
fd_set fds_write;
fd_set fds_err;
- curl_socket_t sockfd = CURL_SOCKET_BAD;
- int maxfd = -99;
- ssize_t rc;
- int error = 0;
int clients = 0; /* connected clients */
struct perclient c[2];
@@ -772,15 +768,17 @@ static bool incoming(curl_socket_t listenfd)
do {
int i;
+ ssize_t rc;
+ int error = 0;
+ curl_socket_t sockfd = listenfd;
+ int maxfd = (int)sockfd;
FD_ZERO(&fds_read);
FD_ZERO(&fds_write);
FD_ZERO(&fds_err);
- sockfd = listenfd;
/* there's always a socket to wait for */
FD_SET(sockfd, &fds_read);
- maxfd = (int)sockfd;
for(i = 0; i < 2; i++) {
if(c[i].used) {