Reduce len when moving past spaces in OSC 11 parameter.

pull/2569/head
nicm 2021-02-18 13:30:24 +00:00
parent af3ffa9c41
commit fb42ae3071
1 changed files with 3 additions and 1 deletions

View File

@ -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);