Permalink
Browse files

fix signed v/s unsigned casts warning in ares_gethostbyaddr.c

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information...
1 parent 1ac8333 commit 03c1378e84374fe8102a3968a884c4eec95ca3ef @greearb greearb committed Jul 30, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 ares_gethostbyaddr.c
View
@@ -265,11 +265,11 @@ static void ptr_rr_name(char *name, const struct ares_addr *addr)
if (addr->family == AF_INET)
{
unsigned long laddr = ntohl(addr->addrV4.s_addr);
- int a1 = (int)((laddr >> 24) & 0xff);
- int a2 = (int)((laddr >> 16) & 0xff);
- int a3 = (int)((laddr >> 8) & 0xff);
- int a4 = (int)(laddr & 0xff);
- sprintf(name, "%d.%d.%d.%d.in-addr.arpa", a4, a3, a2, a1);
+ unsigned short a1 = (unsigned short)((laddr >> 24) & 0xff);
+ unsigned short a2 = (unsigned short)((laddr >> 16) & 0xff);
+ unsigned short a3 = (unsigned short)((laddr >> 8) & 0xff);
+ unsigned short a4 = (unsigned short)(laddr & 0xff);
+ sprintf(name, "%hu.%hu.%hu.%hu.in-addr.arpa", a4, a3, a2, a1);
}
else
{

0 comments on commit 03c1378

Please sign in to comment.