diff --git a/src/crypto/tree-hash.c b/src/crypto/tree-hash.c index a2b0eeaa..87423fb8 100644 --- a/src/crypto/tree-hash.c +++ b/src/crypto/tree-hash.c @@ -19,7 +19,7 @@ void tree_hash(const char (*hashes)[HASH_SIZE], size_t count, char *root_hash) { size_t i, j; size_t cnt = count - 1; char (*ints)[HASH_SIZE]; - for (i = 1; i < sizeof(size_t); i <<= 1) { + for (i = 1; i < 8 * sizeof(size_t); i <<= 1) { cnt |= cnt >> i; } cnt &= ~(cnt >> 1);