diff --git a/blackbox.c b/blackbox.c index f8d6b27..7918c53 100644 --- a/blackbox.c +++ b/blackbox.c @@ -305,7 +305,7 @@ struct game_state { #define GRID(s,x,y) ((s)->grid[(y)*((s)->w+2) + (x)]) -#define RANGECHECK(s,x) ((x) >= 0 && (x) <= (s)->nlasers) +#define RANGECHECK(s,x) ((x) >= 0 && (x) < (s)->nlasers) /* specify numbers because they must match array indexes. */ enum { DIR_UP = 0, DIR_RIGHT = 1, DIR_DOWN = 2, DIR_LEFT = 3 };