aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-19 22:46:54 +0000
committerYang Tse <yangsita@gmail.com>2008-10-19 22:46:54 +0000
commitb843c27322937b31879a12b6f37f71f630638753 (patch)
tree61378fdbbc78fa4a7bd4cbdb4189055d51d51b13
parent2688cf343bdcab56c781e1932c42aadea7bacb39 (diff)
fix compiler warning
-rw-r--r--lib/hostip.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 3a5f642fb..fe3b9320f 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -181,21 +181,21 @@ int Curl_num_addresses(const Curl_addrinfo *addr)
const char *
Curl_printable_address(const Curl_addrinfo *ai, char *buf, size_t bufsize)
{
- struct sockaddr_in *sa4;
- struct in_addr *ipaddr4;
+ const struct sockaddr_in *sa4;
+ const struct in_addr *ipaddr4;
#ifdef ENABLE_IPV6
- struct sockaddr_in6 *sa6;
- struct in6_addr *ipaddr6;
+ const struct sockaddr_in6 *sa6;
+ const struct in6_addr *ipaddr6;
#endif
switch (ai->ai_family) {
case AF_INET:
- sa4 = (struct sockaddr_in *)ai->ai_addr;
+ sa4 = (const void *)ai->ai_addr;
ipaddr4 = &sa4->sin_addr;
return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
#ifdef ENABLE_IPV6
case AF_INET6:
- sa6 = (struct sockaddr_in6 *)ai->ai_addr;
+ sa6 = (const void *)ai->ai_addr;
ipaddr6 = &sa6->sin6_addr;
return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
#endif