diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-05-25 12:12:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-05-25 12:12:59 +0000 |
commit | c0c4bd0bea4fcfbe0e0c37330c43e6cde27df363 (patch) | |
tree | e8739d1634b81d0109ec8e76b8b54bdf0713467d /usr.bin | |
parent | 12a902d9075e697e6d9a47faa51eee52df5c273b (diff) |
Do not attempt to divide by zero when working out copy position.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/window-copy.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index a2226b33cd5..cc25e6fbc5a 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.289 2020/05/25 09:32:10 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.290 2020/05/25 12:12:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -3167,7 +3167,7 @@ window_copy_match_at_cursor(struct window_copy_mode_data *data) */ for (at = start; at <= end; at++) { py = at / sx; - px = at % (py * sx); + px = at - (py * sx); grid_get_cell(gd, px, py, &gc); buf = xrealloc(buf, len + gc.data.size + 1); |