diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-01-26 11:04:33 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-01-27 09:19:01 +0100 |
commit | 764c6bd3bf2e7a1f8bc33162ab77b667770f4f73 (patch) | |
tree | 01321aab74a16bd212e36675ec0e1af556008a30 /lib/url.c | |
parent | 642d78026f409cfb5b31affc271a0eb8298e8020 (diff) | |
download | curl-764c6bd3bf2e7a1f8bc33162ab77b667770f4f73.tar.gz |
urldata: remove duplicate port number storage
... and use 'int' for ports. We don't use 'unsigned short' since -1 is
still often used internally to signify "unknown value" and 0 - 65535 are
all valid port numbers.
Closes #6534
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2319,7 +2319,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, curl_proxytype proxytype) { char *portptr = NULL; - long port = -1; + int port = -1; char *proxyuser = NULL; char *proxypasswd = NULL; char *host; @@ -2408,14 +2408,14 @@ static CURLcode parse_proxy(struct Curl_easy *data, curl_url_get(uhp, CURLUPART_PORT, &portptr, 0); if(portptr) { - port = strtol(portptr, NULL, 10); + port = (int)strtol(portptr, NULL, 10); free(portptr); } else { if(data->set.proxyport) /* None given in the proxy string, then get the default one if it is given */ - port = data->set.proxyport; + port = (int)data->set.proxyport; else { if(proxytype == CURLPROXY_HTTPS) port = CURL_DEFAULT_HTTPS_PROXY_PORT; |