strtomp: update the returned char* even if there were no characters parsed

This commit is contained in:
aiju 2016-08-28 01:08:26 +02:00
parent 261ec9fe0e
commit 913ce62cfc

View file

@ -240,13 +240,13 @@ strtomp(char *a, char **pp, int base, mpint *b)
return nil; return nil;
} }
if(pp != nil)
*pp = e;
// if no characters parsed, there wasn't a number to convert // if no characters parsed, there wasn't a number to convert
if(e == a) if(e == a)
return nil; return nil;
if(pp != nil)
*pp = e;
b->sign = sign; b->sign = sign;
return mpnorm(b); return mpnorm(b);
} }