From e51c2168e971f508042d6a86782a9a10d8f1db3a Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 8 Jun 2014 15:52:34 +0200 Subject: [PATCH] fix segfault. Closes T1286 --- src/bin/termptyesc.c | 1 + src/bin/termptyops.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c index f8f34d9f..2c6889b1 100644 --- a/src/bin/termptyesc.c +++ b/src/bin/termptyesc.c @@ -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; diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c index 05ec5f1f..ed3c6a87 100644 --- a/src/bin/termptyops.c +++ b/src/bin/termptyops.c @@ -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));