* and simply shuffle the grid by making a long sequence of
* randomly chosen moves.
*/
- total_moves = w*h*n*n*2;
+ total_moves = w*h*n*n*2 + random_upto(rs, 1);
for (i = 0; i < total_moves; i++) {
int x, y;
*/
maxlen = state->h * state->w * (col+o+1);
- ret = snewn(maxlen, char);
+ ret = snewn(maxlen+1, char);
p = ret;
for (y = 0; y < state->h; y++) {