I think it depends on what you consider valid use cases of strtoi().
> This is the case when the number is out of range, and there's trailing
> garbage -- e.g., s="42z", min=3, max=7.
Is it correct to consider the first non-digit character garbage? I.e., would
you regard it as an abuse of
Hello Taylor,
On Sat, Jan 20, 2024 at 07:07:57PM +, Taylor R Campbell wrote:
> PR lib/57828 (https://gnats.NetBSD.org/57828) proposes changing an
> edge case of the strtoi(3) function so that if ERANGE and ENOTSUP are
> both applicable then it should fail with ERANGE rather than ENOTSUP.
>
>
> PR lib/57828 (https://gnats.NetBSD.org/57828) proposes changing an
> edge case of the strtoi(3) function so that if ERANGE and ENOTSUP are
> both applicable then it should fail with ERANGE rather than ENOTSUP.
Has it ever been part of strtoi's contract which error it fails with if
multiple
PR lib/57828 (https://gnats.NetBSD.org/57828) proposes changing an
edge case of the strtoi(3) function so that if ERANGE and ENOTSUP are
both applicable then it should fail with ERANGE rather than ENOTSUP.
This is the case when the number is out of range, and there's trailing
garbage -- e.g.,