You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "HERE88 (via GitHub)" <gi...@apache.org> on 2023/07/10 13:02:39 UTC

[GitHub] [nuttx] HERE88 opened a new pull request, #9766: libs/libc/stdlib: fix strtoul,strtoull bugs when value outside range

HERE88 opened a new pull request, #9766:
URL: https://github.com/apache/nuttx/pull/9766

   Prototype:
     unsigned long strtoul(FAR const char *nptr, FAR char **endptr, int base);
     unsigned long long strtoull(FAR const char *nptr,  FAR char **endptr, int base);
   
   If endptr is not NULL, strtoul()/strtoull() should store the address of the first invalid character in *endptr. And if the correct value is outside the range of representable values, {ULONG_MAX} or {ULLONG_MAX} shall be returned and errno set to [ERANGE].
   
   With such code:
     strtoul("34592348345343453453455645765736575865767", &endptr, 10);
   
   It indeed returns ULONG_MAX and sets errno to ERANGE. But after strtoul return, endptr points to "3455645765736575865767", not NULL.
   
   ## Summary
   
   ## Impact
   
   ## Testing
   
   


-- 
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


[GitHub] [nuttx] pkarashchenko merged pull request #9766: libs/libc/stdlib: fix strtoul,strtoull bugs when value outside range

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko merged PR #9766:
URL: https://github.com/apache/nuttx/pull/9766


-- 
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