mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Pattern: fix a compile warning about memset bounds.
The argument to memset was being taken from an int variable that not all compilers are able to prove is non-negative. Adding an assert convinces them.
This commit is contained in:
@ -439,6 +439,8 @@ static bool do_row(unsigned char *known, unsigned char *deduced,
|
||||
int rowlen, i, freespace;
|
||||
bool done_any;
|
||||
|
||||
assert(len >= 0); /* avoid compile warnings about the memsets below */
|
||||
|
||||
freespace = len+1;
|
||||
for (rowlen = 0; data[rowlen]; rowlen++) {
|
||||
minpos_done[rowlen] = minpos_ok[rowlen] = len - 1;
|
||||
|
Reference in New Issue
Block a user