mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-01 12:26:38 -05:00
Fix 32-bit integer truncation in block metadata allocations and file_block
This commit is contained in:
parent
527bd69129
commit
c7b8068e36
5 changed files with 85 additions and 11 deletions
|
|
@ -269,7 +269,7 @@ typedef unsigned char bit_vect_t;
|
|||
|
||||
static inline size_t bit_vect_size(size_t max)
|
||||
{
|
||||
return (max + BIT_VECT_SIZE - 1) / BIT_VECT_SIZE;
|
||||
return (max / BIT_VECT_SIZE) + ((max % BIT_VECT_SIZE) != 0);
|
||||
}
|
||||
|
||||
static inline void bit_vect_set(bit_vect_t* bit_vect, size_t off)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue