diff options
Diffstat (limited to 'libmp/port/mptoui.c')
| -rw-r--r-- | libmp/port/mptoui.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libmp/port/mptoui.c b/libmp/port/mptoui.c index 9d80c1df..41c0b0b6 100644 --- a/libmp/port/mptoui.c +++ b/libmp/port/mptoui.c @@ -25,11 +25,9 @@ mptoui(mpint *b) uint x; x = *b->p; - if(b->sign < 0){ + if(b->sign < 0) x = 0; - } else { - if(b->top > 1 || x > MAXUINT) - x = MAXUINT; - } + else if(b->top > 1 || (sizeof(mpdigit) > sizeof(uint) && x > MAXUINT)) + x = MAXUINT; return x; } |
