Fix bounds checks of dc.col
commita6bbc0c96b0a1db804061b0db79101c6b26aec57
authorPeter Hofmann <scm@uninformativ.de>
Sat, 7 Oct 2023 05:39:00 +0000 (7 07:39 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sat, 7 Oct 2023 10:16:59 +0000 (7 12:16 +0200)
treedae05a1ddf976cf829441f717ff493e9d256abfe
parenteb3b894f4076f2b25afc644a1f444b5cbd96aae8
Fix bounds checks of dc.col

dc.collen is the length of dc.col, not the maximum index, hence if x is
equal to dc.collen, then it's an error.

With config.def.h, the last valid index is 259, so this correctly
reports "black":

    $ printf '\033]4;259;?\e\\'

260 is an invalid index and this reports garbage instead of printing an
error:

    $ printf '\033]4;260;?\e\\'
x.c