libmp: fix mptouv behaviour to match mptoui

front
aiju 2018-12-06 09:32:20 +00:00
parent 17b80cbcf1
commit 64d0d3b8ac
1 changed files with 2 additions and 2 deletions

View File

@ -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++)