diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c --- a/usr.bin/sockstat/main.c +++ b/usr.bin/sockstat/main.c @@ -1196,7 +1196,9 @@ first = true; len = strlen(s->protoname); - if (s->vflag & (INP_IPV4 | INP_IPV6)) + if (s->vflag & INP_IPV4) + len += 1; + if (s->vflag & INP_IPV6) len += 1; cw->proto = MAX(cw->proto, len);