dwm

my fork of dwm
Index Commits Files Refs README LICENSE
commit e81eb46a78c45b41ce7126f980b6d6d8a8ff25da
parent f315832f75ce9f419a2942bc29fcaa737e8b2883
Author: arg@mmvi <unknown>
Date:   Tue, 26 Sep 2006 13:49:16 +0200

added slight error check to getcolor
Diffstat:
Mdraw.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/draw.c b/draw.c
@@ -149,7 +149,8 @@ getcolor(const char *colstr) {
     Colormap cmap = DefaultColormap(dpy, screen);
     XColor color;
 
-    XAllocNamedColor(dpy, cmap, colstr, &color, &color);
+    if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
+        eprint("error, cannot allocate color '%s'\n", colstr);
     return color.pixel;
 }