summaryrefslogtreecommitdiff
path: root/ares_expand_name.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-02-23 18:46:27 +0000
committerYang Tse <yangsita@gmail.com>2010-02-23 18:46:27 +0000
commit78414c0f3a4f7185323f13f04c8a1d5b68102b26 (patch)
treece768fd7c1f73183a7b252cff1be63b881af9e98 /ares_expand_name.c
parent157d68729f5ff4c9eb2f0d5d1fbf8d09cda4b378 (diff)
downloadc-ares-78414c0f3a4f7185323f13f04c8a1d5b68102b26.tar.gz
c-ares-78414c0f3a4f7185323f13f04c8a1d5b68102b26.tar.bz2
c-ares-78414c0f3a4f7185323f13f04c8a1d5b68102b26.zip
fix compiler warning
Diffstat (limited to 'ares_expand_name.c')
-rw-r--r--ares_expand_name.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ares_expand_name.c b/ares_expand_name.c
index 5a48b4d..fd3220d 100644
--- a/ares_expand_name.c
+++ b/ares_expand_name.c
@@ -69,17 +69,21 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
int len, indir = 0;
char *q;
const unsigned char *p;
+ union {
+ ssize_t sig;
+ size_t uns;
+ } nlen;
- len = name_length(encoded, abuf, alen);
- if (len < 0)
+ nlen.sig = name_length(encoded, abuf, alen);
+ if (nlen.sig < 0)
return ARES_EBADNAME;
- *s = malloc(((size_t)len) + 1);
+ *s = malloc(nlen.uns + 1);
if (!*s)
return ARES_ENOMEM;
q = *s;
- if (len == 0) {
+ if (nlen.uns == 0) {
/* RFC2181 says this should be ".": the root of the DNS tree.
* Since this function strips trailing dots though, it becomes ""
*/