You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sc...@apache.org on 2026/06/09 13:44:18 UTC
(tomcat-connectors) 05/20: Use correct conversion for unsigned int
This is an automated email from the ASF dual-hosted git repository.
ChristopherSchultz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-connectors.git
commit 3cc048f50de2eb1baa1e772793faa19b58f9776f
Author: Christopher Schultz <ch...@christopherschultz.net>
AuthorDate: Mon Jun 8 12:03:15 2026 -0400
Use correct conversion for unsigned int
Remove unnecessary cast
---
native/common/jk_connect.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/native/common/jk_connect.c b/native/common/jk_connect.c
index 839e530ab..0bd124c26 100644
--- a/native/common/jk_connect.c
+++ b/native/common/jk_connect.c
@@ -1329,13 +1329,13 @@ char *jk_dump_sinfo(jk_sock_t sd, char *buf, size_t size)
if (lsaddr.sa_family == JK_INET) {
struct sockaddr_in *sa = (struct sockaddr_in *)&lsaddr;
inet_ntop4((unsigned char *)&sa->sin_addr, buf, size);
- snprintf(pb, sizeof(pb), ":%d", (unsigned int)ntohs(sa->sin_port));
+ snprintf(pb, sizeof(pb), ":%u", ntohs(sa->sin_port));
}
#if JK_HAVE_IPV6
else {
struct sockaddr_in6 *sa = (struct sockaddr_in6 *)&lsaddr;
inet_ntop6((unsigned char *)&sa->sin6_addr, buf, size);
- snprintf(pb, sizeof(pb), ":%d", (unsigned int)ntohs(sa->sin6_port));
+ snprintf(pb, sizeof(pb), ":%u", ntohs(sa->sin6_port));
}
#endif
ps = strlen(buf);
@@ -1346,13 +1346,13 @@ char *jk_dump_sinfo(jk_sock_t sd, char *buf, size_t size)
if (rsaddr.sa_family == JK_INET) {
struct sockaddr_in *sa = (struct sockaddr_in *)&rsaddr;
inet_ntop4((unsigned char *)&sa->sin_addr, buf + ps, size - ps);
- snprintf(pb, sizeof(pb), ":%d", (unsigned int)ntohs(sa->sin_port));
+ snprintf(pb, sizeof(pb), ":%u", ntohs(sa->sin_port));
}
#if JK_HAVE_IPV6
else {
struct sockaddr_in6 *sa = (struct sockaddr_in6 *)&rsaddr;
inet_ntop6((unsigned char *)&sa->sin6_addr, buf + ps, size - ps);
- snprintf(pb, sizeof(pb), ":%d", (unsigned int)ntohs(sa->sin6_port));
+ snprintf(pb, sizeof(pb), ":%u", ntohs(sa->sin6_port));
}
#endif
strncat(buf, pb, size - strlen(buf) - 1);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org