docs/143330: [patch] strtonum(3) does undocumented clobbering of errno

Efstratios Karatzas gpf.kira at gmail.com
Thu Jan 28 22:50:11 UTC 2010


>Number:         143330
>Category:       docs
>Synopsis:       [patch] strtonum(3) does undocumented clobbering of errno
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 28 22:50:11 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Efstratios Karatzas
>Release:        FreeBSD 8.0-STABLE i386
>Organization:
>Environment:
FreeBSD Eternal_Crusader 8.0-STABLE FreeBSD 8.0-STABLE #0: Thu Jan 21 17:46:20 EET 2010     root at Eternal_Crusader:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
As noted by commiter Bruce Evans in the pr trail of bin/142911,
strtonum() sets errno to 0 when no error is found.
Checked the source myself and this seems to be the case.
This behavior is undocumented.
>How-To-Repeat:

>Fix:
Take a look at the patch below.
I just added this information in the "return value" 
section of the man page.
First time editing a man page, hope this is ok.

Patch attached with submission follows:

--- strtonum.orig.3	2010-01-29 00:17:25.000000000 +0200
+++ strtonum.3	2010-01-29 00:27:31.000000000 +0200
@@ -84,6 +84,8 @@
 .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 ;


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list