cmapcube: don't crash on initdraw failure

This commit is contained in:
Russ Cox 2020-01-11 06:02:08 -05:00
parent dbf57689c4
commit 2cb85891ba

View file

@ -185,7 +185,8 @@ void main(int argc, char **argv){
break;
}ARGEND
initdraw(0,0,0);
if(initdraw(0,0,0) < 0)
sysfatal("initdraw: %r");
ncolor=256;
for(i=0;i!=ncolor;i++)
color[i] = allocimage(display, Rect(0, 0, 1, 1), CMAP8, 1, cmap2rgba(i));