]> granicus.if.org Git - procps-ng/commit
top: refactor 'mkVIZ' support to avoid future problems
authorJim Warner <james.warner@comcast.net>
Wed, 16 Jun 2021 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Thu, 17 Jun 2021 06:46:33 +0000 (16:46 +1000)
commitdc8137f85b9e65f7a5356c419d6485c60c5a9d14
tree50d3c4550617d5b8862cc9a7d4a8b16a92c84d6f
parent64578746f630ea43cf57e62e7b989a1fb01a7b17
top: refactor 'mkVIZ' support to avoid future problems

In the patch referenced below, 2 potential abends were
fixed both of which involved 'alternate display mode'.

The root cause of those abends was a negative value in
the 'begnext' field for other than the current window.

And while that potential is fixed for now the existing
code almost invites such problems again in the future.

So, this patch will remove any temptation to name some
other window in the 'mkVIZrow1' macro. And, since that
macro is not the only source of 'begnext' changes, the
'mkVizrowX' is being added to identify such occasions.

[ and for symmetry i've added a 'mkVIZyes' macro and ]
[ ameliorated an otherwise surreptitious assignment! ]

Reference(s):
commit 84e85611c36d31a478e1b62e5668671d9389265d

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h