Re: [iproute PATCH 3/3] ss: Fix width calculations when Netid or State columns are missing

2017-10-31 Thread Stefano Brivio
On Tue, 31 Oct 2017 17:55:06 +0100 Stephen Hemminger wrote: > On Sun, 29 Oct 2017 21:22:34 +0100 > Stefano Brivio wrote: > > > + addrp_width -= netid_width + 1 * !!netid_width; > > + addrp_width -= state_width + 1 * !!state_width; > >

Re: [iproute PATCH 3/3] ss: Fix width calculations when Netid or State columns are missing

2017-10-31 Thread Stephen Hemminger
On Sun, 29 Oct 2017 21:22:34 +0100 Stefano Brivio wrote: > + addrp_width -= netid_width + 1 * !!netid_width; > + addrp_width -= state_width + 1 * !!state_width; Doing !! here is being too bit tricky for code that is not performance sensitive. Just use an if

[iproute PATCH 3/3] ss: Fix width calculations when Netid or State columns are missing

2017-10-29 Thread Stefano Brivio
If Netid or State columns are missing, we must not subtract one for each of these two columns from the remaining screen width, while distributing available space to columns. This one character corresponding to one delimiting space has to be subtracted only if the columns are actually printed.