1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Reduce len when moving past spaces in OSC 11 parameter.

This commit is contained in:
nicm 2021-02-18 13:30:24 +00:00
parent de5b078e4d
commit 89d73fb22a

View File

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