summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-28 20:56:17 +0100
committerYang Tse <yangsita@gmail.com>2010-11-28 20:56:17 +0100
commit0ea27cdbbfccfb26001777707d6332b981fdafa0 (patch)
tree3b9364d97d9068a9b6438f2080cf63a637567f67 /ares_init.c
parente3813e6d2412275f8aa4a4b9d6f0c874acef2736 (diff)
downloadc-ares-0ea27cdbbfccfb26001777707d6332b981fdafa0.tar.gz
c-ares-0ea27cdbbfccfb26001777707d6332b981fdafa0.tar.bz2
c-ares-0ea27cdbbfccfb26001777707d6332b981fdafa0.zip
ares_init: fix compiler warning: conversion may lose significant bits
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ares_init.c b/ares_init.c
index 21229ad..442f8f5 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -94,7 +94,7 @@ static int init_id_key(rc4_key* key,int key_data_len);
#if !defined(WIN32) && !defined(WATT32)
static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat);
-static int ip_addr(const char *s, int len, struct in_addr *addr);
+static int ip_addr(const char *s, ssize_t len, struct in_addr *addr);
static void natural_mask(struct apattern *pat);
static int config_domain(ares_channel channel, char *str);
static int config_lookup(ares_channel channel, const char *str,
@@ -1256,16 +1256,16 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
q = str;
while (*q && *q != '/' && *q != ';' && !ISSPACE(*q))
q++;
- memcpy(ipbuf, str, (int)(q-str));
- ipbuf[(int)(q-str)] = '\0';
+ memcpy(ipbuf, str, q-str);
+ ipbuf[q-str] = '\0';
/* Find the prefix */
if (*q == '/')
{
const char *str2 = q+1;
while (*q && *q != ';' && !ISSPACE(*q))
q++;
- memcpy(ipbufpfx, str, (int)(q-str));
- ipbufpfx[(int)(q-str)] = '\0';
+ memcpy(ipbufpfx, str, q-str);
+ ipbufpfx[q-str] = '\0';
str = str2;
}
else
@@ -1293,13 +1293,13 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
return ARES_ENOMEM;
}
/* See if it is just a regular IP */
- else if (ip_addr(ipbuf, (int)(q-str), &pat.addrV4) == 0)
+ else if (ip_addr(ipbuf, q-str, &pat.addrV4) == 0)
{
if (ipbufpfx[0])
{
- memcpy(ipbuf, str, (int)(q-str));
- ipbuf[(int)(q-str)] = '\0';
- if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr4) != 0)
+ memcpy(ipbuf, str, q-str);
+ ipbuf[q-str] = '\0';
+ if (ip_addr(ipbuf, q-str, &pat.mask.addr4) != 0)
natural_mask(&pat);
}
else
@@ -1497,7 +1497,7 @@ static int sortlist_alloc(struct apattern **sortlist, int *nsort,
return 1;
}
-static int ip_addr(const char *ipbuf, int len, struct in_addr *addr)
+static int ip_addr(const char *ipbuf, ssize_t len, struct in_addr *addr)
{
/* Four octets and three periods yields at most 15 characters. */