~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
math/mp-arith.c (mp_testbit): Want nonstrict comparison for bounds check.
[catacomb]
/
math
/
mp-arith.c
diff --git
a/math/mp-arith.c
b/math/mp-arith.c
index
2d7d635
..
61780b0
100644
(file)
--- 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);
}