From: Martin Schanzenbach Date: Mon, 25 May 2020 10:01:23 +0000 (+0200) Subject: fix bit check in hash X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=19e3bd32adb2f8926b78bbec7a17c3b1c11b716e;p=oweals%2Fgnunet.git fix bit check in hash --- diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index c41c419ff..4982ba404 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c @@ -252,7 +252,7 @@ GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, unsigned int bit) { GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode)); - return (((unsigned char *) code)[bit >> 3] & (1 << (bit & 7))) > 0; + return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0; }