summaryrefslogtreecommitdiff
path: root/acountry.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-10-17 19:04:53 +0000
committerYang Tse <yangsita@gmail.com>2008-10-17 19:04:53 +0000
commit1c9a010cf01bcd8a40b20596707dbc7ce49ed5dc (patch)
treeba29e498e658b3ae0f656d6994054843ed95d111 /acountry.c
parent6642bc38df688741f2cb0dc5afbeb9b4593b877f (diff)
downloadc-ares-1c9a010cf01bcd8a40b20596707dbc7ce49ed5dc.tar.gz
c-ares-1c9a010cf01bcd8a40b20596707dbc7ce49ed5dc.tar.bz2
c-ares-1c9a010cf01bcd8a40b20596707dbc7ce49ed5dc.zip
fix compiler warning
Diffstat (limited to 'acountry.c')
-rw-r--r--acountry.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/acountry.c b/acountry.c
index 52ef62e..37aed60 100644
--- a/acountry.c
+++ b/acountry.c
@@ -523,7 +523,8 @@ static int is_addr(char *str, char **end)
{
int a0, a1, a2, a3, num, rc = 0, length = 0;
- if ((num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length)) == 4 &&
+ num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
+ if( (num == 4) &&
BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
length >= (3+4))
{
@@ -583,8 +584,8 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
if (ver_1)
{
- ccode_A2[0] = tolower(cname[2]);
- ccode_A2[1] = tolower(cname[3]);
+ ccode_A2[0] = (char)tolower(cname[2]);
+ ccode_A2[1] = (char)tolower(cname[3]);
ccode_A2[2] = '\0';
}
else