News for hackers. Stuff that matters.
Re:“People who implement new and improved interfaces always ... by saurik on Friday September 11, 2015 @12:00PM (#10204434)
> And yes, parse_integer() really can return an error, even despite that "isdigit(*str)" check. Think about it. Or just read the source code.

Actually taking the advice of the article and looking at the source code makes it clear that parse_integer is doing what we would hope such an API would: it guarantees that the resulting number fits into the provided integer.

https://lwn.net/Articles/643159/

Re:“People who implement new and improved interfaces always ... by mikeash on Friday September 11, 2015 @12:41PM (#10204681)
Returning an error is fine, but the code that calls the function doesn't check for errors, and just blindly applies the return value as an offset to a pointer. When the function returns -ERANGE to indicate that the value was too large for the requested data type, entertaining things will occur.