aewl

diff 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
line diff
     1.1 --- a/draw.c	Tue Sep 26 13:30:30 2006 +0200
     1.2 +++ b/draw.c	Tue Sep 26 13:49:16 2006 +0200
     1.3 @@ -149,7 +149,8 @@
     1.4  	Colormap cmap = DefaultColormap(dpy, screen);
     1.5  	XColor color;
     1.6  
     1.7 -	XAllocNamedColor(dpy, cmap, colstr, &color, &color);
     1.8 +	if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
     1.9 +		eprint("error, cannot allocate color '%s'\n", colstr);
    1.10  	return color.pixel;
    1.11  }
    1.12