diff options
| author | Jacob Nevins <jacobn@chiark.greenend.org.uk> | 2005-05-04 12:56:04 +0000 |
|---|---|---|
| committer | Jacob Nevins <jacobn@chiark.greenend.org.uk> | 2005-05-04 12:56:04 +0000 |
| commit | 262118324645da482747ef6c319fc428a40eb716 (patch) | |
| tree | 3edd178d1f8478d4ebe501ad489bccddaba3a694 | |
| parent | 38c1f9b7028c4405e1e8145bc6639e33ffce147b (diff) | |
| download | puzzles-262118324645da482747ef6c319fc428a40eb716.zip puzzles-262118324645da482747ef6c319fc428a40eb716.tar.gz puzzles-262118324645da482747ef6c319fc428a40eb716.tar.bz2 puzzles-262118324645da482747ef6c319fc428a40eb716.tar.xz | |
Allow for trailing '\0' in game_text_format() in various games.
[originally from svn r5743]
| -rw-r--r-- | fifteen.c | 2 | ||||
| -rw-r--r-- | rect.c | 2 | ||||
| -rw-r--r-- | sixteen.c | 2 | ||||
| -rw-r--r-- | twiddle.c | 2 |
4 files changed, 4 insertions, 4 deletions
@@ -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++) { @@ -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++) { @@ -521,7 +521,7 @@ static char *game_text_format(game_state *state) */ 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++) { |