mirror of
https://github.com/apache/nuttx.git
synced 2026-05-14 02:58:01 +08:00
Fixes in strtod parser.
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
3665180795
commit
c83985c5ce
@@ -160,6 +160,7 @@ double strtod(FAR const char *str, FAR char **endptr)
|
||||
{
|
||||
set_errno(ERANGE);
|
||||
number = 0.0;
|
||||
p = (FAR char *)str;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
@@ -195,6 +196,14 @@ double strtod(FAR const char *str, FAR char **endptr)
|
||||
|
||||
/* Process string of digits */
|
||||
|
||||
if (!isdigit(*p))
|
||||
{
|
||||
set_errno(ERANGE);
|
||||
number = 0.0;
|
||||
p = (FAR char *)str;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
n = 0;
|
||||
while (isdigit(*p))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user