aboutsummaryrefslogtreecommitdiff
path: root/ares/ares__get_hostent.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
commit4798f4e65258afb6935d0b471e7d1b5a0d5edf1e (patch)
tree028ca561904652f670439e9952a7b4ef063bdbfa /ares/ares__get_hostent.c
parentb38e28b6bc02c468bd4be4bb04a8bf5220b929f3 (diff)
Fix compiler warning: addition result could be truncated before cast to bigger sized type
Diffstat (limited to 'ares/ares__get_hostent.c')
-rw-r--r--ares/ares__get_hostent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ares/ares__get_hostent.c b/ares/ares__get_hostent.c
index 8402714c4..d98af9283 100644
--- a/ares/ares__get_hostent.c
+++ b/ares/ares__get_hostent.c
@@ -194,7 +194,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
memcpy(hostent->h_addr_list[0], &addr6, addrlen);
/* Copy aliases. */
- hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));
+ hostent->h_aliases = malloc((((size_t)naliases) + 1) * sizeof(char *));
if (!hostent->h_aliases)
break;
alias = hostent->h_aliases;