diff --git a/examples/soak.c b/examples/soak.c index f66728d..48dfed7 100644 --- a/examples/soak.c +++ b/examples/soak.c @@ -541,7 +541,9 @@ verify_sm_is_first_available_span(sparsemap_t *map, sparsemap_idx_t idx, size_t while (sparsemap_is_set(map, i + j) == value && j < len) { j++; } - return i == idx; + if (j == len) { + return i == idx; + } } return false; } diff --git a/include/sparsemap.h b/include/sparsemap.h index db19216..571f431 100644 --- a/include/sparsemap.h +++ b/include/sparsemap.h @@ -289,7 +289,7 @@ void sparsemap_split(sparsemap_t *map, sparsemap_idx_t offset, sparsemap_t *othe * 3 when 0-based). * * @param[in] map The sparsemap reference. - * @param[in] n Specifies how many bits to ignore (when n=3 return the position + * @param[in] n Specifies how many bits to ignore (when n=2 return the position * of the third matching bit). * @param[in] value Determines if the search is to examine set (true) or unset * (false) bits in the bitmap index.