summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2020-05-25 12:12:58 +0000
committernicm <nicm>2020-05-25 12:12:58 +0000
commit4589297e43ad4b385c9110879aab8338d7c45474 (patch)
treeb7bf9e3108dd9f1d19e82131cac2283514fa273f
parent26e8e467e8e4d3e4f4596b9ce50832735cdc4d50 (diff)
Do not attempt to divide by zero when working out copy position.
-rw-r--r--window-copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/window-copy.c b/window-copy.c
index 1efe01d0..b869fc83 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -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);