[hackers] [st] Use LEN(dc.col) instead of LEN(colorname). || noname_AT_inventati.org

From: <git_AT_suckless.org>
Date: Tue, 21 Apr 2015 09:50:35 +0200 (CEST)

commit 84c756b97e31ca6946f634dc329ff8026caa6539
Author: noname_AT_inventati.org <noname_AT_inventati.org>
Date: Sun Apr 19 22:24:44 2015 +0200

    Use LEN(dc.col) instead of LEN(colorname).
    
    LEN(colorname) may be below 256 for some configurations.

diff --git a/st.c b/st.c
index c805117..7f08748 100644
--- a/st.c
+++ b/st.c
_AT_@ -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])) {
_AT_@ -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) {
Received on Tue Apr 21 2015 - 09:50:35 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 21 2015 - 10:00:22 CEST