Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ERRNO in strtol #16

Open
gmmyung opened this issue Jan 15, 2024 · 1 comment
Open

Set ERRNO in strtol #16

gmmyung opened this issue Jan 15, 2024 · 1 comment

Comments

@gmmyung
Copy link
Contributor

gmmyung commented Jan 15, 2024

On success, the function returns the converted integral number as a long int value.
If no valid conversion could be performed, a zero value is returned (0L).
If the value read is out of the range of representable values by a long int, the function returns LONG_MAX or LONG_MIN (defined in [<climits>](https://cplusplus.com/climits)), and [errno](https://cplusplus.com/errno) is set to ERANGE.

Errno should be set to ERANGE when value is out of range. Reimplementing something similar to errno in Newlib might be possible.

@thejpster
Copy link
Member

Seems like a good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants