aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-03-12 20:02:38 +0000
committerThomas Adam <thomas@xteddy.org>2019-03-12 20:02:38 +0000
commitba4a884d753ade5fd285ecedd7bca25c70023058 (patch)
tree50ef58691981234ed74fc2868bd448aaf37c401f /screen-write.c
parent6c3ee42568f3fef75f5daae890f6fb31dd378d95 (diff)
parent2796ae81d0be04df161cffdf447c2d0e5ec895e2 (diff)
downloadrtmux-ba4a884d753ade5fd285ecedd7bca25c70023058.tar.gz
rtmux-ba4a884d753ade5fd285ecedd7bca25c70023058.tar.bz2
rtmux-ba4a884d753ade5fd285ecedd7bca25c70023058.zip
Merge branch 'obsd-master'
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/screen-write.c b/screen-write.c
index a6e78f42..c9cba2bd 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1034,20 +1034,20 @@ screen_write_clearstartofline(struct screen_write_ctx *ctx, u_int bg)
/* Move cursor to px,py. */
void
-screen_write_cursormove(struct screen_write_ctx *ctx, u_int px, u_int py)
+screen_write_cursormove(struct screen_write_ctx *ctx, int px, int py)
{
struct screen *s = ctx->s;
- if (s->mode & MODE_ORIGIN) {
- if (py > s->rlower - s->rupper)
+ if (py != -1 && (s->mode & MODE_ORIGIN)) {
+ if ((u_int)py > s->rlower - s->rupper)
py = s->rlower;
else
py += s->rupper;
}
- if (px > screen_size_x(s) - 1)
+ if (px != -1 && (u_int)px > screen_size_x(s) - 1)
px = screen_size_x(s) - 1;
- if (py > screen_size_y(s) - 1)
+ if (py != -1 && (u_int)py > screen_size_y(s) - 1)
py = screen_size_y(s) - 1;
screen_write_set_cursor(ctx, px, py);