X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..646d0305bfee5d72982ce01151989797b0f5f139:/math/mp-arith.c diff --git a/math/mp-arith.c b/math/mp-arith.c index 2d7d6359..61780b0f 100644 --- a/math/mp-arith.c +++ b/math/mp-arith.c @@ -116,7 +116,7 @@ mp *mp_lsr2c(mp *d, mp *a, size_t n) int mp_testbit(mp *x, unsigned long n) { - if (n > MPW_BITS * MP_LEN(x)) + if (n >= MPW_BITS * MP_LEN(x)) return (0); return ((x->v[n/MPW_BITS] >> n%MPW_BITS) & 1u); }