libmp: fix mptouv behaviour to match mptoui
This commit is contained in:
parent
17b80cbcf1
commit
64d0d3b8ac
1 changed files with 2 additions and 2 deletions
|
@ -33,11 +33,11 @@ mptouv(mpint *b)
|
|||
uvlong v;
|
||||
int s;
|
||||
|
||||
if(b->top == 0)
|
||||
if(b->top == 0 || b->sign < 0)
|
||||
return 0LL;
|
||||
|
||||
if(b->top > VLDIGITS)
|
||||
return MAXVLONG;
|
||||
return -1LL;
|
||||
|
||||
v = 0ULL;
|
||||
for(s = 0; s < b->top; s++)
|
||||
|
|
Loading…
Reference in a new issue