mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
strtof: Also make sure that all integer values use in expressions are cast to float
This commit is contained in:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user