-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add strto[iu]_() and strtou_noneg(). #890
Conversation
a11b446
to
94e100e
Compare
c37a8f3
to
fc015c0
Compare
1f22360
to
027f51e
Compare
Link: https://lists.sr.ht/~hallyn/shadow/%3CZZoQDms6Sv6e5SPE%40debian%3E NetBSD has modified their APIs strtoi(3) and strtou(3) after my bug report, so our implementation will be fully compatible with theirs. libbsd will also adopt that behavior soon. However, for now, let's use our own definitions. |
027f51e
to
b08d626
Compare
v2 changes:
|
These functions are identical to strtoi(3bsd) and strtou(3bsd), except for one important thing: if both ERANGE and ENOTSUP conditions happen, the BSD functions report ENOTSUP, which is bogus; our strtoi_() and strtou_() report ERANGE. Link: <https://lists.sr.ht/~hallyn/shadow/%3CZZoQDms6Sv6e5SPE%40debian%3E> Link: <https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=57828> Cc: Thorsten Glaser <tg@mirbsd.de> Cc: christos <christos@netbsd.org> Cc: roy <roy@netbsd.org> Cc: Guillem Jover <guillem@hadrons.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Fix typo. Signed-off-by: Alejandro Colomar <alx@kernel.org>
It's like strtou_(), but rejects negative input, instead of silently converting it to unsigned. Link: <https://softwareengineering.stackexchange.com/a/449060/332848> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
b08d626
to
570aa4c
Compare
v2b changes:
|
This is in preparation of a rework of
get[u]long()
.