From 2cb85891ba58a83263ef30dc9799d1fda9fb71af Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 11 Jan 2020 06:02:08 -0500 Subject: cmapcube: don't crash on initdraw failure --- src/cmd/draw/cmapcube.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cmd') diff --git a/src/cmd/draw/cmapcube.c b/src/cmd/draw/cmapcube.c index 4d56322b..fd234d60 100644 --- a/src/cmd/draw/cmapcube.c +++ b/src/cmd/draw/cmapcube.c @@ -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)); -- cgit v1.2.3