From c0c4bd0bea4fcfbe0e0c37330c43e6cde27df363 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 25 May 2020 12:12:59 +0000 Subject: Do not attempt to divide by zero when working out copy position. --- usr.bin/tmux/window-copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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 @@ -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); -- cgit v1.2.3