https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225559

--- Comment #9 from Kyle Evans <[email protected]> ---
Hi,

So basically, your assessment is generally right but we'll need to rework the
patch... a lot. This might be more of a Coccinelle job, but basically- every
call to strtol, strotul, strtold that tries to check errno != 0 after the fact
should be setting errno to 0 before-hand, as per POSIX recommendations [1].

Ideally the return value of these functions would always be validated before
errno is consulted, but regardless- a POSIX compliant implementation will not
set errno to 0 on success, so errno != 0 checks alone to signify an error are
bogus without knowing that errno = 0 going into it.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to