diff --git a/sys/src/libmp/port/strtomp.c b/sys/src/libmp/port/strtomp.c index 51d462101..b0b7d2898 100644 --- a/sys/src/libmp/port/strtomp.c +++ b/sys/src/libmp/port/strtomp.c @@ -240,13 +240,13 @@ strtomp(char *a, char **pp, int base, mpint *b) return nil; } + if(pp != nil) + *pp = e; + // if no characters parsed, there wasn't a number to convert if(e == a) return nil; - if(pp != nil) - *pp = e; - b->sign = sign; return mpnorm(b); }