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

-T (at least) supports only base 10 & silently rejects malformed numbers #19

Open
ISSOtm opened this issue May 21, 2020 · 1 comment
Open
Assignees

Comments

@ISSOtm
Copy link
Contributor

ISSOtm commented May 21, 2020

superfamiconv map -T 0x80 apparently treats the argument as 0, silently discarding the x80 part. I didn't check with other options.

C stdlib has strtoul which handles this correctly with a base of 0, and error checking is possible by checking the returned pointer. (Example.) I don't know if there's a C++ way of doing that, though.

@Optiroc Optiroc self-assigned this May 21, 2020
@Rangi42
Copy link

Rangi42 commented Jul 31, 2021

strtoul works fine in C++ too. It also offers std::stoi but that throws an exception on failure.

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

No branches or pull requests

3 participants