https://issues.apache.org/bugzilla/show_bug.cgi?id=52832
--- Comment #3 from Olaf van der Spek <[email protected]> --- (In reply to Tianyin Xu from comment #2) > Being fed with a overflowed number, atoi() will return a random number. > > for example, on my machine, ind b = atoi(10000000000), b will be 1410065408. Actually it's worse: "If the value cannot be represented, the behavior is undefined." http://pubs.opengroup.org/onlinepubs/009695399/functions/atoi.html Code using strtol often fails to check for ERANGE too. IMO the best solution would be to introduce a better strtol wrapper that returns an int/error on invalid input. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
