From 9491ce7f692555517af50eab2debf5d7418272e9 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 25 Apr 2014 21:47:15 -0400 Subject: don't let move_to move outside of the screen --- src/screen.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/screen.c b/src/screen.c index 0c8ced5..94e70f9 100644 --- a/src/screen.c +++ b/src/screen.c @@ -121,6 +121,14 @@ void runes_screen_move_to(RunesTerm *t, int row, int col) row++; } + if (col < 0) { + col = 0; + } + + if (col > t->scr.max.col) { + col = t->scr.max.col; + } + scr->cur.row = row; scr->cur.col = col; } -- cgit v1.2.3-54-g00ecf