st

simple terminal

git clone https://9o.is/git/st.git

commit 9654ac7faffe0fb15c83713e5ebfdc1b4b570078
parent 7be2c63e968d58c1d616c6e19434e0a1b934793f
Author: noname@inventati.org <noname@inventati.org>
Date:   Sun, 19 Apr 2015 22:24:44 +0200

Use LEN(dc.col) instead of LEN(colorname).

LEN(colorname) may be below 256 for some configurations.

Diffstat:
Mst.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/st.c b/st.c @@ -2911,7 +2911,7 @@ xloadcols(void) { } /* load colors [0-15] and [256-LEN(colorname)] (config.h) */ - for(i = 0; i < LEN(colorname); i++) { + for(i = 0; i < LEN(dc.col); i++) { if(!colorname[i]) continue; if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.col[i])) { @@ -2942,7 +2942,7 @@ xsetcolorname(int x, const char *name) { XRenderColor color = { .alpha = 0xffff }; Color ncolor; - if(!BETWEEN(x, 0, LEN(colorname))) + if(!BETWEEN(x, 0, LEN(dc.col))) return 1; if(!name) {