]> granicus.if.org Git - apache/commitdiff
fix some abuse of apr_port_t (flagged by Sun WorkShop)
authorJeff Trawick <trawick@apache.org>
Fri, 22 Mar 2002 21:41:14 +0000 (21:41 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 22 Mar 2002 21:41:14 +0000 (21:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94142 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/proxy_util.c

index 7ce7f318de120c6cc232e79c1013cc55bf971a4c..4fc1a958c4bf414bdd6d11d387b6c8f324e83d7f 100644 (file)
@@ -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;