From 69e0ffe36f844c19d6554d2c51fde9c38e933897 Mon Sep 17 00:00:00 2001 From: William Lupton Date: Thu, 4 Jun 1998 19:26:48 +0000 Subject: [PATCH] fixed array bound problem (BESSY) --- src/sequencer/gen_tables.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sequencer/gen_tables.c b/src/sequencer/gen_tables.c index 9dc7ddd42..3c0605d7a 100644 --- a/src/sequencer/gen_tables.c +++ b/src/sequencer/gen_tables.c @@ -16,6 +16,7 @@ 20jul95,ajk Added unsigned types. 22jul96,ajk Added castS to action, event, delay, and exit functions. 09mar98,wfl Avoided compilation warnings under Tornado +11mar98,wfl Corrected calculation of number of event words. ***************************************************************************/ /*#define DEBUG 1*/ @@ -211,8 +212,8 @@ gen_state_blocks() bitMask *pEventMask; - /* Allocate an array for event mask bits */ - numEventWords = (num_events + num_channels + NBITS - 1)/NBITS; + /* Allocate an array for event mask bits (NB, bit zero is not used) */ + numEventWords = (num_events + num_channels + NBITS)/NBITS; pEventMask = (bitMask *)calloc(numEventWords, sizeof (bitMask)); /* for all state sets ... */