chiark / gitweb /
Make cellsize a char.
authorPhil Bordelon <phil@thenexusproject.org>
Mon, 5 Jun 2017 03:48:56 +0000 (23:48 -0400)
committerSimon Tatham <anakin@pobox.com>
Mon, 5 Jun 2017 17:36:20 +0000 (18:36 +0100)
Apparently new versions of GCC get grumpy if the possible range for a sprintf()
call exceeds MAXINT, which would never happen in actuality here due to the size
of the puzzles we're dealing with... but the compiler doesn't know that, of
course, so thinks that something may have gone horribly awry.  Changing it to a
char solves the problem neatly.

range.c

diff --git a/range.c b/range.c
index 588178c003a349929e040ddbb0151f51d9bc723c..4dd39b97cd499f62cbd53c0d636cb26713b92d09 100644 (file)
--- a/range.c
+++ b/range.c
@@ -1159,7 +1159,8 @@ static int game_can_format_as_text_now(const game_params *params)
 
 static char *game_text_format(const game_state *state)
 {
-    int cellsize, r, c, i, w_string, h_string, n_string;
+    int r, c, i, w_string, h_string, n_string;
+    char cellsize;
     char *ret, *buf, *gridline;
 
     int const w = state->params.w, h = state->params.h;