ref: 35ab5a74c2a8a7e197f35b833694aa28d12bade7
parent: 00c19a0e1f446f1ca083b2cba96b6cc37a7cde44
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Sep 8 05:54:25 EDT 2016
libmp: update mptov.c and mplogic.c from 9front
--- a/libmp/mplogic.c
+++ b/libmp/mplogic.c
@@ -141,7 +141,7 @@
m = n % Dbits;
if(b->sign == -1){
c = 1;
- for(i = 0; i <= r->top; i++){
+ for(i = 0; i < r->top; i++){
if(i < b->top)
r->p[i] = ~(b->p[i] - c);
else
--- a/libmp/mptouv.c
+++ b/libmp/mptouv.c
@@ -14,10 +14,10 @@
int s;
if(b == nil){
- b = mpnew(VLDIGITS*sizeof(mpdigit));
+ b = mpnew(VLDIGITS*Dbits);
setmalloctag(b, getcallerpc(&v));
}else
- mpbits(b, VLDIGITS*sizeof(mpdigit));
+ mpbits(b, VLDIGITS*Dbits);
b->sign = 1;
for(s = 0; s < VLDIGITS; s++){
b->p[s] = v;