mirror of
https://github.com/osmarks/ngircd.git
synced 2026-10-04 06:41:44 +00:00
Fix "implicit conversion shortens 64-bit value" warning
This patch fixes the following gcc warning in our sources: "implicit conversion shortens 64-bit value into a 32-bit value"
This commit is contained in:
@@ -151,7 +151,8 @@ ng_ipaddr_tostr_r(const ng_ipaddr_t *addr, char *str)
|
||||
if (*str == ':') {
|
||||
char tmp[NG_INET_ADDRSTRLEN] = "0";
|
||||
ret = getnameinfo(sa, ng_ipaddr_salen(addr),
|
||||
tmp+1, sizeof(tmp) -1, NULL, 0, NI_NUMERICHOST);
|
||||
tmp + 1, (socklen_t)sizeof(tmp) - 1,
|
||||
NULL, 0, NI_NUMERICHOST);
|
||||
if (ret == 0)
|
||||
strlcpy(str, tmp, NG_INET_ADDRSTRLEN);
|
||||
}
|
||||
|
||||
@@ -58,10 +58,10 @@ ng_ipaddr_salen(const ng_ipaddr_t *a)
|
||||
#ifdef WANT_IPV6
|
||||
assert(a->sa.sa_family == AF_INET || a->sa.sa_family == AF_INET6);
|
||||
if (a->sa.sa_family == AF_INET6)
|
||||
return sizeof(a->sin6);
|
||||
return (socklen_t)sizeof(a->sin6);
|
||||
#endif
|
||||
assert(a->sin4.sin_family == AF_INET);
|
||||
return sizeof(a->sin4);
|
||||
return (socklen_t)sizeof(a->sin4);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,4 +115,3 @@ ng_ipaddr_tostr_r(const ng_ipaddr_t *addr, char *d)
|
||||
#endif
|
||||
|
||||
/* -eof- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user