From: Harald Welte Date: Tue, 24 Jun 2003 18:15:59 +0000 (+0000) Subject: Fix printing of odd ip6tables netmasks (Closes: #103) X-Git-Tag: v1.2.9-rc1~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8a50ab83de750cc489e2965e2f017a9db7a894b3;p=thirdparty%2Fiptables.git Fix printing of odd ip6tables netmasks (Closes: #103) --- diff --git a/ip6tables.c b/ip6tables.c index 17bdb4e5..664b307b 100644 --- a/ip6tables.c +++ b/ip6tables.c @@ -578,10 +578,13 @@ addr_to_host(const struct in6_addr *addr) static char * mask_to_numeric(const struct in6_addr *addrp) { - static char buf[20]; + static char buf[50+2]; int l = ipv6_prefix_length(addrp); - if (l == -1) - return addr_to_numeric(addrp); + if (l == -1) { + strcpy(buf, "/"); + strcat(buf, addr_to_numeric(addrp)); + return buf; + } sprintf(buf, "/%d", l); return buf; }