shithub: puzzles

Download patch

ref: 1380b55b5b9b5a841f3375f6c3f614105f1b6884
parent: c4198948a8019903b250fec426d973e8f32abacd
author: Jonas Kölker <jonaskoelker@yahoo.com>
date: Mon Sep 21 11:55:53 EDT 2015

Fix segfault in Range's game_text_format.

Occurred on Nx1 puzzles, etc.

--- a/range.c
+++ b/range.c
@@ -1167,7 +1167,7 @@
     cellsize = 0; /* or may be used uninitialized */
 
     for (c = 0; c < w; ++c) {
-        for (r = 1; r < h; ++r) {
+        for (r = 0; r < h; ++r) {
             puzzle_size k = state->grid[idx(r, c, w)];
             int d;
             for (d = 0; k; k /= 10, ++d);