From fb42ae3071763fdc6a2fe2e57feec774623b1c33 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 18 Feb 2021 13:30:24 +0000 Subject: Reduce len when moving past spaces in OSC 11 parameter. --- input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'input.c') diff --git a/input.c b/input.c index 590a157d..f6aeb027 100644 --- a/input.c +++ b/input.c @@ -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); -- cgit