added slight error check to getcolor

pull/1/head
arg@mmvi 18 years ago
parent f315832f75
commit e81eb46a78
  1. 3
      draw.c

@ -149,7 +149,8 @@ getcolor(const char *colstr) {
Colormap cmap = DefaultColormap(dpy, screen); Colormap cmap = DefaultColormap(dpy, screen);
XColor color; 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; return color.pixel;
} }

Loading…
Cancel
Save