mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:33:33 +03:00
compiler warning fix
This commit is contained in:
parent
1c63ceb317
commit
d2dd3d7e16
5 changed files with 11 additions and 9 deletions
|
|
@ -110,7 +110,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||
port = addr->sin_port;
|
||||
else
|
||||
port = addr6->sin6_port;
|
||||
service = lookup_service(port, flags, buf, sizeof(buf));
|
||||
service = lookup_service((unsigned short)(port & 0xffff),
|
||||
flags, buf, sizeof(buf));
|
||||
callback(arg, ARES_SUCCESS, NULL, service);
|
||||
return;
|
||||
}
|
||||
|
|
@ -151,7 +152,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||
}
|
||||
/* They also want a service */
|
||||
if (flags & ARES_NI_LOOKUPSERVICE)
|
||||
service = lookup_service(port, flags, srvbuf, sizeof(srvbuf));
|
||||
service = lookup_service((unsigned short)(port & 0xffff),
|
||||
flags, srvbuf, sizeof(srvbuf));
|
||||
callback(arg, ARES_SUCCESS, ipbuf, service);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
|||
memset(&sockin, 0, sizeof(sockin));
|
||||
sockin.sin_family = AF_INET;
|
||||
sockin.sin_addr = server->addr;
|
||||
sockin.sin_port = channel->tcp_port;
|
||||
sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
|
||||
int err = GET_ERRNO();
|
||||
|
||||
|
|
@ -642,7 +642,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
|||
memset(&sockin, 0, sizeof(sockin));
|
||||
sockin.sin_family = AF_INET;
|
||||
sockin.sin_addr = server->addr;
|
||||
sockin.sin_port = channel->udp_port;
|
||||
sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||
{
|
||||
closesocket(s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue