aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unfinished/group.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/unfinished/group.c b/unfinished/group.c
index 74a63fc..c303326 100644
--- a/unfinished/group.c
+++ b/unfinished/group.c
@@ -1430,8 +1430,9 @@ static game_state *execute_move(const game_state *from, const char *move)
/*
* Eliminate any obsoleted dividers.
*/
- for (x = 0; x+1 < w; x++) {
- int i = ret->sequence[x], j = ret->sequence[x+1];
+ for (x = 0; x < w; x++) {
+ int i = ret->sequence[x];
+ int j = (x+1 < w ? ret->sequence[x+1] : -1);
if (ret->dividers[i] != j)
ret->dividers[i] = -1;
}