diff options
author | 2021-02-18 13:30:24 +0000 | |
---|---|---|
committer | 2021-02-18 13:30:24 +0000 | |
commit | 89d73fb22a353f9ffa43453e66e8eb28e659d76a (patch) | |
tree | b3e8edf4a8919a8ff17ece54eabbf97ce932bde0 /usr.bin/tmux/input.c | |
parent | Release mbuf(9) chain with a simple m_freem(9) loop in sorflush(). (diff) | |
download | wireguard-openbsd-89d73fb22a353f9ffa43453e66e8eb28e659d76a.tar.xz wireguard-openbsd-89d73fb22a353f9ffa43453e66e8eb28e659d76a.zip |
Reduce len when moving past spaces in OSC 11 parameter.
Diffstat (limited to 'usr.bin/tmux/input.c')
-rw-r--r-- | usr.bin/tmux/input.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index cbf25b2ec3f..0ce7a65adfc 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.187 2021/02/15 14:22:35 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.188 2021/02/18 13:30:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -2460,8 +2460,10 @@ input_osc_parse_colour(const char *p) (1 - m) * (1 - k) * 255, (1 - y) * (1 - k) * 255); } else { - while (*p == ' ') + while (len != 0 && *p == ' ') { p++; + len--; + } while (len != 0 && p[len - 1] == ' ') len--; copy = xstrndup(p, len); |