Remove extraneous underscores at start and end of Rectangles seeds.

[originally from svn r4473]
This commit is contained in:
Simon Tatham
2004-08-17 11:51:20 +00:00
parent 2b392a9d5a
commit ae63b8010b

8
rect.c
View File

@ -881,7 +881,13 @@ char *new_game_seed(game_params *params, random_state *rs)
run -= c - ('a' - 1);
}
} else {
*p++ = '_';
/*
* If there's a number in the very top left or
* bottom right, there's no point putting an
* unnecessary _ before or after it.
*/
if (p > seed && n > 0)
*p++ = '_';
}
if (n > 0)
p += sprintf(p, "%d", n);