1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Cast the length to socklen_t

socklen_t usually unsigned int where as size_t is unsigned long on
64bit
This commit is contained in:
Matt Clarkson
2015-05-21 17:13:26 +01:00
parent 40dc5c6d81
commit 5d8291ca9c

View File

@@ -1452,12 +1452,12 @@ static void sockaddr_to_string(char *buf, size_t len, const union usa *usa)
if (usa->sa.sa_family == AF_INET) {
getnameinfo(
&usa->sa, sizeof(usa->sin), buf, len, NULL, 0, NI_NUMERICHOST);
&usa->sa, sizeof(usa->sin), buf, (socklen_t)len, NULL, 0, NI_NUMERICHOST);
}
#if defined(USE_IPV6)
else if (usa->sa.sa_family == AF_INET6) {
getnameinfo(
&usa->sa, sizeof(usa->sin6), buf, len, NULL, 0, NI_NUMERICHOST);
&usa->sa, sizeof(usa->sin6), buf, (socklen_t)len, NULL, 0, NI_NUMERICHOST);
}
#endif