diff options
| author | Charles.Forsyth <devnull@localhost> | 2008-06-12 21:45:38 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2008-06-12 21:45:38 +0000 |
| commit | d9bd3181330830c49e714609e86eaa3e39a884ca (patch) | |
| tree | 9836330fa12c11f4dafce942e3eb23f8fcdf80c9 /libmp/port/mptoui.c | |
| parent | 3d7a0c16959c77d931f7fdd2022945a563bbff10 (diff) | |
20080612-2245
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; } |
