hexedit: fixes for redraw and down movement causing SEGV on attempt to access
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 23 Jul 2018 12:21:07 +0000 (14:21 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 30 Jul 2018 16:02:27 +0000 (18:02 +0200)
commitabe8fc3663152dd5050c7025f897a758f32d0212
tree8319d6434be2f2cfe8fc1846fefeac19721a2ae0
parent981c0b109dce7972e30074847880a6f91d2dfda9
hexedit: fixes for redraw and down movement causing SEGV on attempt to access

"Go to:" command was not updating row position, making next "down" movements
for one screenful print empty lines instead of showing the contents.

If the file is whole pages long, "down" movement at EOF was advancing position
+16 bytes, mapping the next portion (entirely past the end of the file),
then finding out that the new position is beyond the EOF, rolling it back
-16 bytes... ending up with this postion pointing *before* the mapped portion.
Any next access (e.g. "move right" key) SEGVs.

function                                             old     new   delta
hexedit_main                                        1170    1184     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/hexedit.c