tcmapcube: don't crash on initdraw failure - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 2cb85891ba58a83263ef30dc9799d1fda9fb71af
(DIR) parent dbf57689c45611b8da9e269c24e409ee33a877d5
(HTM) Author: Russ Cox <rsc@swtch.com>
Date: Sat, 11 Jan 2020 06:02:08 -0500
cmapcube: don't crash on initdraw failure
Diffstat:
M src/cmd/draw/cmapcube.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/cmd/draw/cmapcube.c b/src/cmd/draw/cmapcube.c
t@@ -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));