| Summary: | [patch] strtonum(3) does undocumented clobbering of errno | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Documentation | Reporter: | Efstratios Karatzas <gpf.kira> <gpf.kira> | ||||
| Component: | Books & Articles | Assignee: | Benedict Reuschling <bcr> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Efstratios Karatzas <gpf.kira@gmail.com>
2010-01-28 22:50:11 UTC
Responsible Changed From-To: freebsd-doc->bcr I'll work on it. Author: bcr (doc committer) Date: Thu Oct 21 18:30:48 2010 New Revision: 214148 URL: http://svn.freebsd.org/changeset/base/214148 Log: Document strtonum()s behavior of setting errno to 0 when no error is found. PR: docs/143330 Submitted by: Efstratios Karatzas (gpf dot kira at gmail dot com) Discussed with: ru@ MFC after: 7 days Modified: head/lib/libc/stdlib/strtonum.3 Modified: head/lib/libc/stdlib/strtonum.3 ============================================================================== --- head/lib/libc/stdlib/strtonum.3 Thu Oct 21 18:21:19 2010 (r214147) +++ head/lib/libc/stdlib/strtonum.3 Thu Oct 21 18:30:48 2010 (r214148) @@ -83,6 +83,8 @@ is set, and .Fa errstr will point to an error message. On success, +.Va errno +is set to 0 and .Fa *errstr will be set to .Dv NULL ; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: open->patched Your patch was committed to HEAD. Until the MFC is done, this PR remains in patched state. State Changed
From-To: patched->closed
A small test program by jh@ proves that this is not the case:
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int
main()
{
errno = EDOOFUS;
if (strtonum("1", 1, 10, NULL) == 0)
err(1, "failed");
printf("%dn", errno);
return (0);
}
The original commit was reverted in r214200. PR closed.
|