Tag 1.2.40

git-svn-id: https://svn.apache.org/repos/asf/tomcat/jk/tags/JK_1_2_40@1586629 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/native/common/jk_connect.c b/native/common/jk_connect.c
index 95874a6..1593978 100644
--- a/native/common/jk_connect.c
+++ b/native/common/jk_connect.c
@@ -339,7 +339,7 @@
      * Do not copy the pointer but use the same offset relative
      * to the struct start
      */
-    out->ipaddr_ptr = (void *)out + (in->ipaddr_ptr - (void *)in);
+    out->ipaddr_ptr = (char *)out + ((char *)in->ipaddr_ptr - (char *)in);
 }
 
 /** Resolve the host IP
@@ -443,7 +443,7 @@
 #endif
             hints.ai_family = JK_INET;
         if (port > 0) {
-            snprintf(pbuf, port, sizeof(pbuf));
+            snprintf(pbuf, sizeof(pbuf), "%d", port);
             pbufptr = pbuf;
         }
         error = getaddrinfo(host, pbufptr, &hints, &ai_list);