aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-03-12 14:02:40 +0000
committerThomas Adam <thomas@xteddy.org>2019-03-12 14:02:40 +0000
commit7d2004a8dd372d5e165232075b42e7b019dae969 (patch)
treebf04edb7eaeab44d310941fc7dc6d528e79000e6 /screen-write.c
parent860acecc0d0dccad41176e20026707492f0f5826 (diff)
parent303d20a758a2779f76854b6df10f8764e44fc407 (diff)
downloadrtmux-7d2004a8dd372d5e165232075b42e7b019dae969.tar.gz
rtmux-7d2004a8dd372d5e165232075b42e7b019dae969.tar.bz2
rtmux-7d2004a8dd372d5e165232075b42e7b019dae969.zip
Merge branch 'obsd-master'
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index e8aa0973..a6e78f42 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -75,7 +75,7 @@ screen_write_set_cursor(struct screen_write_ctx *ctx, int cx, int cy)
return;
if (cx != -1) {
- if ((u_int)cx > screen_size_x(s) - 1)
+ if ((u_int)cx > screen_size_x(s)) /* allow last column */
cx = screen_size_x(s) - 1;
s->cx = cx;
}
@@ -1045,6 +1045,11 @@ screen_write_cursormove(struct screen_write_ctx *ctx, u_int px, u_int py)
py += s->rupper;
}
+ if (px > screen_size_x(s) - 1)
+ px = screen_size_x(s) - 1;
+ if (py > screen_size_y(s) - 1)
+ py = screen_size_y(s) - 1;
+
screen_write_set_cursor(ctx, px, py);
}