fix a bug of strtof

This commit is contained in:
lilei19 2023-02-21 19:40:24 +08:00 committed by Xiang Xiao
parent f8d3032732
commit e6e2017d3c
1 changed files with 2 additions and 1 deletions

View File

@ -335,7 +335,8 @@ static long_double decfloat(FAR char *ptr, FAR char **endptr)
}
}
if ((c | 32) == 'e')
if ((c | 32) == 'e' && (isdigit(*f) || ((*f == '+' || *f == '-') &&
(isdigit(*(f + 1))))))
{
num_decimal = scanexp(&f, 1) + num_decimal;
if (num_decimal <= llong_min / 100)