This day’s frustrating debugging session sponsored by shitty error handling in <stdlib.h>, namely that atoi(garbage) == 0 and so it’s not straightforward to tell if the 0 was there or not :cirno_for_reals:
>The functions atof, atoi, atol, and atoll need not affect the value of the integer expression errno on an error. If the value of the result cannot be represented, the behavior is undefined.
Add comment