ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp,
char **passwordp, char **hostp, apr_port_t *port)
{
- apr_port_t i;
+ int i;
char *strp, *host, *url = *urlp;
char *user = NULL, *password = NULL;
if (strp[i] != '\0') {
return "Bad port number in URL";
} else if (i > 0) {
- *port = atoi(strp);
- if (*port > 65535)
+ int int_port = atoi(strp);
+
+ if (int_port > 65535)
return "Port number in URL > 65535";
+
+ *port = (apr_port_t)int_port;
}
}
ap_str_tolower(host); /* DNS names are case-insensitive */
proxy_get_host_of_request(request_rec *r)
{
char *url, *user = NULL, *password = NULL, *err, *host;
- apr_port_t port = -1;
+ apr_port_t port;
if (r->hostname != NULL)
return r->hostname;