diff options
author | ihsinme <61293369+ihsinme@users.noreply.github.com> | 2020-07-05 15:19:25 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-07-12 22:52:19 +0200 |
commit | 60aa96128889a59c87d760ffb0947d451c2103a3 (patch) | |
tree | 26320634fa1710eed0dc883d2f4279ce9cad590e /lib/socks.c | |
parent | 2bd8fe882314f1f82a98dfab5f7d3e1765372c68 (diff) | |
download | curl-60aa96128889a59c87d760ffb0947d451c2103a3.tar.gz |
socks: use size_t for size variable
Use the unsigned type (size_t) in the arithmetic of pointers. In this
context, the signed type (ssize_t) is used unnecessarily.
Authored-by: ihsinme on github
Closes #5654
Diffstat (limited to 'lib/socks.c')
-rw-r--r-- | lib/socks.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/socks.c b/lib/socks.c index b2215fef3..44783d015 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -327,18 +327,18 @@ CURLcode Curl_SOCKS4(const char *proxy_user, * Make connection */ { - ssize_t packetsize = 9 + + size_t packetsize = 9 + strlen((char *)socksreq + 8); /* size including NUL */ /* If SOCKS4a, set special invalid IP address 0.0.0.x */ if(protocol4a) { - ssize_t hostnamelen = 0; + size_t hostnamelen = 0; socksreq[4] = 0; socksreq[5] = 0; socksreq[6] = 0; socksreq[7] = 1; /* append hostname */ - hostnamelen = (ssize_t)strlen(hostname) + 1; /* length including NUL */ + hostnamelen = strlen(hostname) + 1; /* length including NUL */ if(hostnamelen <= 255) strcpy((char *)socksreq + packetsize, hostname); else { |