Mercurial > dwm-meillo
comparison draw.c @ 495:3a812750f983
added slight error check to getcolor
author | arg@mmvi |
---|---|
date | Tue, 26 Sep 2006 13:49:16 +0200 |
parents | be4f90c03582 |
children | e5f8d6ac509c |
comparison
equal
deleted
inserted
replaced
494:36f9bb3da949 | 495:3a812750f983 |
---|---|
147 unsigned long | 147 unsigned long |
148 getcolor(const char *colstr) { | 148 getcolor(const char *colstr) { |
149 Colormap cmap = DefaultColormap(dpy, screen); | 149 Colormap cmap = DefaultColormap(dpy, screen); |
150 XColor color; | 150 XColor color; |
151 | 151 |
152 XAllocNamedColor(dpy, cmap, colstr, &color, &color); | 152 if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color)) |
153 eprint("error, cannot allocate color '%s'\n", colstr); | |
153 return color.pixel; | 154 return color.pixel; |
154 } | 155 } |
155 | 156 |
156 void | 157 void |
157 setfont(const char *fontstr) { | 158 setfont(const char *fontstr) { |