X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=unfinished%2Fgroup.c;fp=unfinished%2Fgroup.c;h=c3033264258fcef28d51f09b6040a039f37502de;hb=cdc1224233dc2c0de2605d9a555d98b13245f513;hp=74a63fc2a04a19be7bd5b3be83af550bcee9fde5;hpb=96626d9c10bd37d060f9cf843b717350c222a344;p=sgt-puzzles.git 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; }