diff options
author | Peter Palfrader <peter@palfrader.org> | 2007-07-27 04:45:42 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2007-07-27 04:45:42 +0000 |
commit | 49db52abe6e9668a63c0bd6c5ac7c7dfd98751ff (patch) | |
tree | b840af07207484d6fdd531bacf71678f95bf9351 /src/common/container.h | |
parent | 1f4275451b08be964b4ec71181d12fa70800ffa4 (diff) | |
download | tor-49db52abe6e9668a63c0bd6c5ac7c7dfd98751ff.tar.gz tor-49db52abe6e9668a63c0bd6c5ac7c7dfd98751ff.zip |
Maybe fix #471. Compute the size of bitfields more correctly. Nick, please check.
svn:r10941
Diffstat (limited to 'src/common/container.h')
-rw-r--r-- | src/common/container.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/container.h b/src/common/container.h index a342b26670..6a73caac0a 100644 --- a/src/common/container.h +++ b/src/common/container.h @@ -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>. */ |