mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-25 08:25:47 +01:00
Use LEN(dc.col) instead of LEN(colorname).
LEN(colorname) may be below 256 for some configurations.
This commit is contained in:
parent
2fdcc5e5f6
commit
84c756b97e
1 changed files with 2 additions and 2 deletions
4
st.c
4
st.c
|
@ -2911,7 +2911,7 @@ xloadcols(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* load colors [0-15] and [256-LEN(colorname)] (config.h) */
|
/* 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])
|
if(!colorname[i])
|
||||||
continue;
|
continue;
|
||||||
if(!XftColorAllocName(xw.dpy, xw.vis, xw.cmap, colorname[i], &dc.col[i])) {
|
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 };
|
XRenderColor color = { .alpha = 0xffff };
|
||||||
Color ncolor;
|
Color ncolor;
|
||||||
|
|
||||||
if(!BETWEEN(x, 0, LEN(colorname)))
|
if(!BETWEEN(x, 0, LEN(dc.col)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if(!name) {
|
if(!name) {
|
||||||
|
|
Loading…
Reference in a new issue