From eab06b27dbfd41695c9afb97db95a96abd2b1ec6 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 22 Mar 2002 21:41:14 +0000 Subject: [PATCH] fix some abuse of apr_port_t (flagged by Sun WorkShop) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94142 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_util.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 7ce7f318de..4fc1a958c4 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -214,7 +214,7 @@ PROXY_DECLARE(char *) 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; @@ -267,9 +267,12 @@ PROXY_DECLARE(char *) 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 */ @@ -604,7 +607,7 @@ static const char * 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; -- 2.40.0