diff options
| author | arg@mmvi <unknown> | 2006-09-26 13:49:16 +0200 |
|---|---|---|
| committer | arg@mmvi <unknown> | 2006-09-26 13:49:16 +0200 |
| commit | e81eb46a78c45b41ce7126f980b6d6d8a8ff25da (patch) | |
| tree | d65f91944733b7b7c9bc9cde1458e8e79542efc1 /draw.c | |
| parent | small fix (diff) | |
| download | dwm-e81eb46a78c45b41ce7126f980b6d6d8a8ff25da.tar.gz dwm-e81eb46a78c45b41ce7126f980b6d6d8a8ff25da.zip | |
added slight error check to getcolor
Diffstat (limited to 'draw.c')
| -rw-r--r-- | draw.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -149,7 +149,8 @@ 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 | ||
