bitvect: fix block_count() on 0-sized bit-vectors
The bug was introduced by 522373984c.
* src/misc/bitvect.hh (block_count): Here.
* src/tgbatest/dstar.test: Add a test case.
This commit is contained in:
parent
91789b9b12
commit
4f31a9bbed
2 changed files with 32 additions and 2 deletions
|
|
@ -131,7 +131,7 @@ namespace spot
|
|||
size_t used_blocks() const
|
||||
{
|
||||
const size_t bpb = 8 * sizeof(block_t);
|
||||
return (size_ - 1) / bpb + 1;
|
||||
return (size_ + bpb - 1) / bpb;
|
||||
}
|
||||
|
||||
/// Append one bit.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue