aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
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 28efa0c5..8668efa2 100644
--- a/cmd.c
+++ b/cmd.c
@@ -600,8 +600,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);
}