You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/29 15:04:49 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6952: Fixes in strtod parser.

pkarashchenko commented on code in PR #6952:
URL: https://github.com/apache/incubator-nuttx/pull/6952#discussion_r957458971


##########
libs/libc/stdlib/lib_strtod.c:
##########
@@ -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;

Review Comment:
   ```suggestion
             p = (FAR char *)str;
   ```
   



##########
libs/libc/stdlib/lib_strtod.c:
##########
@@ -160,6 +160,7 @@ double strtod(FAR const char *str, FAR char **endptr)
     {
       set_errno(ERANGE);
       number = 0.0;
+      p = (FAR char *) str;

Review Comment:
   ```suggestion
         p = (FAR char *)str;
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org