mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-10-05 23:59:35 +00:00
Fix compiler warning: addition result could be truncated before cast to bigger sized type
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user