SuperFamiconv icon indicating copy to clipboard operation
SuperFamiconv copied to clipboard

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

Open ISSOtm opened this issue 5 years ago • 1 comments
trafficstars

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.

ISSOtm avatar May 21 '20 15:05 ISSOtm

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

Rangi42 avatar Jul 31 '21 07:07 Rangi42