mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 16:32:13 -07:00
Allow for trailing '\0' in game_text_format() in various games.
[originally from svn r5743]
This commit is contained in:
@ -421,7 +421,7 @@ static char *game_text_format(game_state *state)
|
||||
*/
|
||||
maxlen = state->h * state->w * (col+1);
|
||||
|
||||
ret = snewn(maxlen, char);
|
||||
ret = snewn(maxlen+1, char);
|
||||
p = ret;
|
||||
|
||||
for (y = 0; y < state->h; y++) {
|
||||
|
2
rect.c
2
rect.c
@ -1081,7 +1081,7 @@ static char *game_text_format(game_state *state)
|
||||
*/
|
||||
maxlen = (2*state->h+1) * (state->w * (col+1) + 2);
|
||||
|
||||
ret = snewn(maxlen, char);
|
||||
ret = snewn(maxlen+1, char);
|
||||
p = ret;
|
||||
|
||||
for (y = 0; y <= 2*state->h; y++) {
|
||||
|
@ -429,7 +429,7 @@ static char *game_text_format(game_state *state)
|
||||
*/
|
||||
maxlen = state->h * state->w * (col+1);
|
||||
|
||||
ret = snewn(maxlen, char);
|
||||
ret = snewn(maxlen+1, char);
|
||||
p = ret;
|
||||
|
||||
for (y = 0; y < state->h; y++) {
|
||||
|
Reference in New Issue
Block a user