diff options
| author | 2010-09-08 20:36:42 +0000 | |
|---|---|---|
| committer | 2010-09-08 20:36:42 +0000 | |
| commit | 37ee16265d39bf5fd2dd9e04d9f56a5791fbdfc5 (patch) | |
| tree | b5aa8670bd843b5ffa8be21cc8f53998fed0ffea /usr.bin/tmux/window-copy.c | |
| parent | Add support for Terratec EWX 24/96 based on initial diff from ratchov@. (diff) | |
| download | wireguard-openbsd-37ee16265d39bf5fd2dd9e04d9f56a5791fbdfc5.tar.xz wireguard-openbsd-37ee16265d39bf5fd2dd9e04d9f56a5791fbdfc5.zip | |
Do not crash if the screen size is too small for the indicator in copy mode.
Diffstat (limited to 'usr.bin/tmux/window-copy.c')
| -rw-r--r-- | usr.bin/tmux/window-copy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 55da4992104..c7ad610e28a 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.61 2010/07/22 21:10:51 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.62 2010/09/08 20:36:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1055,6 +1055,8 @@ window_copy_write_line( if (py == 0) { size = xsnprintf(hdr, sizeof hdr, "[%u/%u]", data->oy, screen_hsize(data->backing)); + if (size > screen_size_x(s)) + size = screen_size_x(s); screen_write_cursormove(ctx, screen_size_x(s) - size, 0); screen_write_puts(ctx, &gc, "%s", hdr); } else if (py == last && data->inputtype != WINDOW_COPY_OFF) { |
