Xinqi Bao's Git
projects
/
dmenu.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
error handling
[dmenu.git]
/
draw.c
diff --git
a/draw.c
b/draw.c
index
dafc107
..
68b8cb7
100644
(file)
--- a/
draw.c
+++ b/
draw.c
@@
-76,12
+76,12
@@
drawtext(const char *text, unsigned long col[ColLast]) {
}
unsigned long
}
unsigned long
-getcolor(const char *colstr
, const char *alternate
) {
+getcolor(const char *colstr) {
Colormap cmap = DefaultColormap(dpy, screen);
XColor color;
Colormap cmap = DefaultColormap(dpy, screen);
XColor color;
- if(
XAllocNamedColor(dpy, cmap, colstr, &color, &color) != Success
)
-
XAllocNamedColor(dpy, cmap, alternate, &color, &colo
r);
+ if(
!XAllocNamedColor(dpy, cmap, colstr, &color, &color)
)
+
eprint("error, cannot allocate color '%s'\n", colst
r);
return color.pixel;
}
return color.pixel;
}