gotcha_atoi too good
Closed this issue · 2 comments
In the testing work, I've gotten builds with libc and gotcha-libc. The libc one fails when I try --52 (0), but gotchas does not. We're the ones breaking the standard, they're the ones who are bad at math.
Do we want to fix this?
In general the general case, I don't think we should do significant work to match the POSIX standard in our glibc replacment functions. These functions just need to operate well enough to serve gotcha, not general code.
In this specific case I could go either way. It's a trivial swap from a 'while' to a 'if'. If making that change eases testing, then let's do so. Otherwise we could just not test this case, and I doubt the difference would ever have an actual impact on our code.
I'll test that we match 0 or 52, if we're either POSIX or correct LGTM. Thanks for the feedback