summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authornicm <nicm>2016-10-05 12:32:13 +0000
committernicm <nicm>2016-10-05 12:32:13 +0000
commitb4f95c43fca75a3ee713fdf76fe55bb1e8ebba36 (patch)
tree4285c2e9b9979ff4bec78e9f16e938e62452201f /cmd.c
parent1b31d148c94f48932f439baa4d336e7de1035ddf (diff)
Allow cmd_mouse_at return arguments to be NULL.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd.c b/cmd.c
index c643a346..f5889a7e 100644
--- a/cmd.c
+++ b/cmd.c
@@ -601,8 +601,10 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
if (y < wp->yoff || y >= wp->yoff + wp->sy)
return (-1);
- *xp = x - wp->xoff;
- *yp = y - wp->yoff;
+ if (xp != NULL)
+ *xp = x - wp->xoff;
+ if (yp != NULL)
+ *yp = y - wp->yoff;
return (0);
}