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;
>
>
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
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.