aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-09 20:38:38 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-09 21:26:35 +0000
commite66d027a81211d327319cf45bb4155e689513f72 (patch)
tree138411d17b24e724090d2a7360c0d7c14b1509fb
parent171e7a76ed271b90ab8717939c02c1bce9b1fced (diff)
downloadpuzzles-e66d027a81211d327319cf45bb4155e689513f72.zip
puzzles-e66d027a81211d327319cf45bb4155e689513f72.tar.gz
puzzles-e66d027a81211d327319cf45bb4155e689513f72.tar.bz2
puzzles-e66d027a81211d327319cf45bb4155e689513f72.tar.xz
Fix Pattern row clues when a row has no black in
I'd failed to initialise the row clue string to empty so it got the contents of the previous row to be displayed. This could only happen for imported descriptions, or for puzzles with one or two columns. Thanks to Glen Sawyer for spotting and reporting the bug.
-rw-r--r--pattern.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pattern.c b/pattern.c
index 92d8a79..489eb54 100644
--- a/pattern.c
+++ b/pattern.c
@@ -1841,6 +1841,7 @@ static void draw_numbers(
size_t off = 0;
assert(rowlen <= state->common->rowsize);
+ *ds->strbuf = '\0';
for (j = 0; j < rowlen; j++)
off += sprintf(ds->strbuf + off, "%s%d", j ? " " : "", rowdata[j]);
y = ry;