fix segfault. Closes T1286

This commit is contained in:
Boris Faure 2014-06-08 15:52:34 +02:00
parent 503dd08105
commit e51c2168e9
2 changed files with 2 additions and 1 deletions

View File

@ -946,6 +946,7 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
{
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;
ty->state.scroll_y1 = arg - 1;
ty->state.scroll_y2 = arg2;

View File

@ -92,7 +92,7 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear)
else
{
cells = &(TERMPTY_SCREEN(ty, 0, end_y));
for (y = start_y; y < end_y; y++)
for (y = start_y; y < end_y - 1; y++)
{
cells = &(TERMPTY_SCREEN(ty, 0, (y + 1)));
cells2 = &(TERMPTY_SCREEN(ty, 0, y));