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.
This commit is contained in:
Ben Harris
2023-01-09 20:38:38 +00:00
parent 171e7a76ed
commit e66d027a81

View File

@ -1841,6 +1841,7 @@ static void draw_numbers(
size_t off = 0; size_t off = 0;
assert(rowlen <= state->common->rowsize); assert(rowlen <= state->common->rowsize);
*ds->strbuf = '\0';
for (j = 0; j < rowlen; j++) for (j = 0; j < rowlen; j++)
off += sprintf(ds->strbuf + off, "%s%d", j ? " " : "", rowdata[j]); off += sprintf(ds->strbuf + off, "%s%d", j ? " " : "", rowdata[j]);
y = ry; y = ry;