diff --git a/src/other.c b/src/other.c index f9df885..21a19f4 100644 --- a/src/other.c +++ b/src/other.c @@ -298,7 +298,7 @@ const char *ntop_ipaddr_init(const union ipaddr_t *ip __attribute__ ((unused))) const char *ntop_ipaddr_v4(const union ipaddr_t *ip) { - static char buffer[sizeof("255.255.255.255")]; + static char buffer[INET_ADDRSTRLEN]; struct in_addr addr; addr.s_addr = htonl(ip->v4); @@ -307,7 +307,7 @@ const char *ntop_ipaddr_v4(const union ipaddr_t *ip) const char *ntop_ipaddr_v6(const union ipaddr_t *ip) { - static char buffer[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; + static char buffer[INET6_ADDRSTRLEN]; struct in6_addr addr; memcpy(addr.s6_addr, ip->v6, sizeof(addr.s6_addr));