diff options
author | noname@inventati.org <noname@inventati.org> | 2015-04-19 22:24:44 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2015-04-21 08:13:46 +0200 |
commit | 84c756b97e31ca6946f634dc329ff8026caa6539 (patch) | |
tree | 7594a2d1320e31be9ec6e475b1a6fc7788524abe /st.c | |
parent | 2fdcc5e5f633083eb5e52b201862106a2c547df9 (diff) | |
download | st-84c756b97e31ca6946f634dc329ff8026caa6539.tar.gz st-84c756b97e31ca6946f634dc329ff8026caa6539.zip |
Use LEN(dc.col) instead of LEN(colorname).
LEN(colorname) may be below 256 for some configurations.
Diffstat (limited to 'st.c')
-rw-r--r-- | st.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2911,7 +2911,7 @@ xloadcols(void) { | |||
2911 | } | 2911 | } |
2912 | 2912 | ||
2913 | /* load colors [0-15] and [256-LEN(colorname)] (config.h) */ | 2913 | /* load colors [0-15] and [256-LEN(colorname)] (config.h) */ |
2914 | for(i = 0; i < LEN(colorname); i++) { | 2914 | for(i = 0; i < LEN(dc.col); i++) { |
2915 | if(!colorname[i]) | 2915 | if(!colorname[i]) |
2916 | continue; | 2916 | continue; |
2917 | if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.col[i])) { | 2917 | if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.col[i])) { |
@@ -2942,7 +2942,7 @@ xsetcolorname(int x, const char *name) { | |||
2942 | XRenderColor color = { .alpha = 0xffff }; | 2942 | XRenderColor color = { .alpha = 0xffff }; |
2943 | Color ncolor; | 2943 | Color ncolor; |
2944 | 2944 | ||
2945 | if(!BETWEEN(x, 0, LEN(colorname))) | 2945 | if(!BETWEEN(x, 0, LEN(dc.col))) |
2946 | return 1; | 2946 | return 1; |
2947 | 2947 | ||
2948 | if(!name) { | 2948 | if(!name) { |