mptrunc: don't write to r->p[r->top]
This commit is contained in:
parent
560ea5474c
commit
d552fed385
1 changed files with 1 additions and 1 deletions
|
@ -141,7 +141,7 @@ mptrunc(mpint *b, int n, mpint *r)
|
||||||
m = n % Dbits;
|
m = n % Dbits;
|
||||||
if(b->sign == -1){
|
if(b->sign == -1){
|
||||||
c = 1;
|
c = 1;
|
||||||
for(i = 0; i <= r->top; i++){
|
for(i = 0; i < r->top; i++){
|
||||||
if(i < b->top)
|
if(i < b->top)
|
||||||
r->p[i] = ~(b->p[i] - c);
|
r->p[i] = ~(b->p[i] - c);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue