summaryrefslogtreecommitdiff
path: root/ares_expand_name.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-10-08 00:02:32 +0000
committerYang Tse <yangsita@gmail.com>2009-10-08 00:02:32 +0000
commit716d5817dcf828222bf2c7bc166ea7b24c2d515b (patch)
treeafbbb9d1798927e3e7892bdcbd8a631e4ae98f9d /ares_expand_name.c
parentc2d3e82931e6406f725a3da83fa11f3bc1b3aac7 (diff)
downloadc-ares-716d5817dcf828222bf2c7bc166ea7b24c2d515b.tar.gz
c-ares-716d5817dcf828222bf2c7bc166ea7b24c2d515b.tar.bz2
c-ares-716d5817dcf828222bf2c7bc166ea7b24c2d515b.zip
Fix compiler warning: addition result could be truncated before cast to bigger sized type
Diffstat (limited to 'ares_expand_name.c')
-rw-r--r--ares_expand_name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ares_expand_name.c b/ares_expand_name.c
index b0af474..a1556e9 100644
--- a/ares_expand_name.c
+++ b/ares_expand_name.c
@@ -71,10 +71,10 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
const unsigned char *p;
len = name_length(encoded, abuf, alen);
- if (len == -1)
+ if (len < 0)
return ARES_EBADNAME;
- *s = malloc(len + 1);
+ *s = malloc(((size_t)len) + 1);
if (!*s)
return ARES_ENOMEM;
q = *s;