mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05:00
fix compiler warning
This commit is contained in:
parent
2688cf343b
commit
b843c27322
12
lib/hostip.c
12
lib/hostip.c
@ -181,21 +181,21 @@ int Curl_num_addresses(const Curl_addrinfo *addr)
|
|||||||
const char *
|
const char *
|
||||||
Curl_printable_address(const Curl_addrinfo *ai, char *buf, size_t bufsize)
|
Curl_printable_address(const Curl_addrinfo *ai, char *buf, size_t bufsize)
|
||||||
{
|
{
|
||||||
struct sockaddr_in *sa4;
|
const struct sockaddr_in *sa4;
|
||||||
struct in_addr *ipaddr4;
|
const struct in_addr *ipaddr4;
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
struct sockaddr_in6 *sa6;
|
const struct sockaddr_in6 *sa6;
|
||||||
struct in6_addr *ipaddr6;
|
const struct in6_addr *ipaddr6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (ai->ai_family) {
|
switch (ai->ai_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
sa4 = (struct sockaddr_in *)ai->ai_addr;
|
sa4 = (const void *)ai->ai_addr;
|
||||||
ipaddr4 = &sa4->sin_addr;
|
ipaddr4 = &sa4->sin_addr;
|
||||||
return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
|
return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr4, buf, bufsize);
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
sa6 = (struct sockaddr_in6 *)ai->ai_addr;
|
sa6 = (const void *)ai->ai_addr;
|
||||||
ipaddr6 = &sa6->sin6_addr;
|
ipaddr6 = &sa6->sin6_addr;
|
||||||
return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
|
return Curl_inet_ntop(ai->ai_family, (const void *)ipaddr6, buf, bufsize);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user