strtof: Also make sure that all integer values use in expressions are cast to float

This commit is contained in:
Gregory Nutt 2016-10-20 13:06:55 -06:00
parent e30a47ba46
commit 9438c42fff

View File

@ -132,7 +132,7 @@ float strtof(FAR const char *str, FAR char **endptr)
while (isdigit(*p))
{
number = number * 10.0F + (*p - '0');
number = number * 10.0F + (float)(*p - '0');
p++;
num_digits++;
}
@ -145,7 +145,7 @@ float strtof(FAR const char *str, FAR char **endptr)
while (isdigit(*p))
{
number = number * 10.0F + (*p - '0');
number = number * 10.0F + (float)(*p - '0');
p++;
num_digits++;
num_decimals++;