chiark
/
gitweb
/
~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 2d7d63593b602e1f44138553ade35cad2551de92..61780b0f44d928c6de5a16577847eafa9ff3ad75 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);
}