~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c8e76b
)
math/mp-arith.c (mp_testbit): Want nonstrict comparison for bounds check.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 3 Jun 2016 21:25:02 +0000
(22:25 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 4 Jun 2016 00:05:47 +0000
(
01:05
+0100)
math/mp-arith.c
patch
|
blob
|
blame
|
history
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);
}