Use proper bounds checking on VPA.

We must check against tp->t_cursor.tp_row, not row, to figure out
whether we must clamp the cursor position.

Submitted by:	luigi
MFC after:	3 weeks
This commit is contained in:
Ed Schouten 2010-12-05 10:15:23 +00:00
parent 5c06c8a134
commit 9d67d2214f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216198

View File

@ -1299,10 +1299,9 @@ teken_subr_vertical_position_absolute(teken_t *t, unsigned int row)
{
t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1;
if (row >= t->t_originreg.ts_end)
if (t->t_cursor.tp_row >= t->t_originreg.ts_end)
t->t_cursor.tp_row = t->t_originreg.ts_end - 1;
t->t_stateflags &= ~TS_WRAPPED;
teken_funcs_cursor(t);
}