From 4589297e43ad4b385c9110879aab8338d7c45474 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 25 May 2020 12:12:58 +0000 Subject: [PATCH] Do not attempt to divide by zero when working out copy position. --- window-copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);