Fix 32-bit integer truncation in block metadata allocations and file_block

This commit is contained in:
Andrea Mazzoleni 2026-08-26 17:06:28 +02:00
parent 527bd69129
commit c7b8068e36
5 changed files with 85 additions and 11 deletions

View file

@ -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)