History

fix cols bounds

mischief committed 11 years ago

Commit 8bc11711 parent f91da351 file · +2 −1Browse files

Unified · Split

hack9.c+2−1
@@ -28,6 +28,7 @@ enum · 27 unmodified lines
28 CRED,28 CRED,
29 CGREY,29 CGREY,
30 CMAGENTA,30 CMAGENTA,
31 CEND,
31};32};
32 33
33typedef struct Msg Msg;34typedef struct Msg Msg;
@@ -80,7 +81,7 @@ initui(char *name) · 46 unmodified lines
80 if((ui.tiles = opentile(buf, 32, 32)) == nil)81 if((ui.tiles = opentile(buf, 32, 32)) == nil)
81 sysfatal("opentile: %r");82 sysfatal("opentile: %r");
82 83
83 if((ui.cols = mallocz(5 * sizeof(Image*), 1)) == nil)84 if((ui.cols = mallocz(CEND * sizeof(Image*), 1)) == nil)
84 sysfatal("malloc cols: %r");85 sysfatal("malloc cols: %r");
85 86
86 ui.cols[CGREEN] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DGreen);87 ui.cols[CGREEN] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DGreen);