diff options
author | 2019-06-14 15:35:58 +0000 | |
---|---|---|
committer | 2019-06-14 15:35:58 +0000 | |
commit | 8b65c88bf637d1a890564e9e8522b895d0aef046 (patch) | |
tree | c69ad31db5bcdbfdfff642acc28e740fc110118b | |
parent | Note a segv with fprintf if a file with long lines is loaded with (diff) | |
download | wireguard-openbsd-8b65c88bf637d1a890564e9e8522b895d0aef046.tar.xz wireguard-openbsd-8b65c88bf637d1a890564e9e8522b895d0aef046.zip |
Do not loop forever if a menu item contains invisible characters,
reported by Thomas Sattler.
-rw-r--r-- | usr.bin/tmux/format-draw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/format-draw.c b/usr.bin/tmux/format-draw.c index e1d3c8aaa1f..da361b41029 100644 --- a/usr.bin/tmux/format-draw.c +++ b/usr.bin/tmux/format-draw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format-draw.c,v 1.9 2019/05/23 14:44:33 nicm Exp $ */ +/* $OpenBSD: format-draw.c,v 1.10 2019/06/14 15:35:58 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -791,7 +791,8 @@ format_width(const char *expanded) } else if (*cp > 0x1f && *cp < 0x7f) { width++; cp++; - } + } else + cp++; } return (width); } |