termptyesc: restrict values on scrolling regions

This commit is contained in:
Boris Faure 2017-05-16 22:48:18 +02:00
parent 17e5e1be55
commit 63d65ed4bb
1 changed files with 2 additions and 3 deletions

View File

@ -1072,9 +1072,8 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
else
{
DBG("2 regions args: %i %i", arg, arg2);
if (arg >= ty->h) arg = ty->h - 1;
if (arg == 0) arg = 1;
if (arg2 > ty->h) arg2 = ty->h;
TERMPTY_RESTRICT_FIELD(arg, 1, ty->h);
TERMPTY_RESTRICT_FIELD(arg2, 1, ty->h);
ty->termstate.scroll_y1 = arg - 1;
ty->termstate.scroll_y2 = arg2;
if ((arg == 1) && (arg2 == ty->h))