Maybe fix #471. Compute the size of bitfields more correctly. Nick, please check.

svn:r10941
This commit is contained in:
Peter Palfrader
2007-07-27 04:45:42 +00:00
parent 1f4275451b
commit 49db52abe6
+1 -1
View File
@@ -282,7 +282,7 @@ typedef unsigned int bitarray_t;
static INLINE bitarray_t *
bitarray_init_zero(int n_bits)
{
size_t sz = (n_bits+BITARRAY_MASK) & BITARRAY_MASK;
size_t sz = (n_bits+BITARRAY_MASK) / (1u << BITARRAY_SHIFT);
return tor_malloc_zero(sz*sizeof(unsigned int));
}
/** Free the bit array <b>ba</b>. */