strtomp: update the returned char* even if there were no characters parsed
This commit is contained in:
parent
261ec9fe0e
commit
913ce62cfc
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue