aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar noname@inventati.org <noname@inventati.org>2015-04-19 22:24:44 +0200
committerGravatar Roberto E. Vargas Caballero <k0ga@shike2.com>2015-04-21 08:13:46 +0200
commit84c756b97e31ca6946f634dc329ff8026caa6539 (patch)
tree7594a2d1320e31be9ec6e475b1a6fc7788524abe
parent2fdcc5e5f633083eb5e52b201862106a2c547df9 (diff)
Use LEN(dc.col) instead of LEN(colorname).
LEN(colorname) may be below 256 for some configurations.
-rw-r--r--st.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/st.c b/st.c
index c805117..7f08748 100644
--- 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) {