aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-01-11 06:02:08 -0500
committerRuss Cox <rsc@swtch.com>2020-01-13 16:46:14 -0500
commit2cb85891ba58a83263ef30dc9799d1fda9fb71af (patch)
tree1e2c65a9cd5586acd49f8baaf920d1bd21549830 /src
parentdbf57689c45611b8da9e269c24e409ee33a877d5 (diff)
downloadplan9port-2cb85891ba58a83263ef30dc9799d1fda9fb71af.tar.gz
plan9port-2cb85891ba58a83263ef30dc9799d1fda9fb71af.tar.bz2
plan9port-2cb85891ba58a83263ef30dc9799d1fda9fb71af.zip
cmapcube: don't crash on initdraw failure
Diffstat (limited to 'src')
-rw-r--r--src/cmd/draw/cmapcube.c3
1 files changed, 2 insertions, 1 deletions
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));