billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=e51c2168e971f508042d6a86782a9a10d8f1db3a

commit e51c2168e971f508042d6a86782a9a10d8f1db3a
Author: Boris Faure <[email protected]>
Date:   Sun Jun 8 15:52:34 2014 +0200

    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 f8f34d9..2c6889b 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 05ec5f1..ed3c6a8 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));

-- 


Reply via email to