aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fifteen.c2
-rw-r--r--rect.c2
-rw-r--r--sixteen.c2
-rw-r--r--twiddle.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/fifteen.c b/fifteen.c
index c29e9fe..0ed5067 100644
--- a/fifteen.c
+++ b/fifteen.c
@@ -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++) {
diff --git a/rect.c b/rect.c
index abfd332..ffb3725 100644
--- a/rect.c
+++ b/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++) {
diff --git a/sixteen.c b/sixteen.c
index cd6ae3b..950f724 100644
--- a/sixteen.c
+++ b/sixteen.c
@@ -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++) {
diff --git a/twiddle.c b/twiddle.c
index 5209606..b03ca01 100644
--- a/twiddle.c
+++ b/twiddle.c
@@ -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++) {