diff options
| author | Simon Tatham <anakin@pobox.com> | 2021-12-11 13:56:12 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2021-12-11 13:56:12 +0000 |
| commit | b56c994b721f7cb5c5bcf09c5d695d4ae07d3052 (patch) | |
| tree | 330edece694feb35f5be415cc8f4ba57dea81942 | |
| parent | d399a6b23051335ce3107f11822ae352816fcd50 (diff) | |
| download | puzzles-b56c994b721f7cb5c5bcf09c5d695d4ae07d3052.zip puzzles-b56c994b721f7cb5c5bcf09c5d695d4ae07d3052.tar.gz puzzles-b56c994b721f7cb5c5bcf09c5d695d4ae07d3052.tar.bz2 puzzles-b56c994b721f7cb5c5bcf09c5d695d4ae07d3052.tar.xz | |
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.
| -rw-r--r-- | pattern.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |