Date: Thu, 28 Jan 2010 22:42:30 GMT From: Efstratios Karatzas <gpf.kira@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: docs/143330: [patch] strtonum(3) does undocumented clobbering of errno Message-ID: <201001282242.o0SMgUpn074249@www.freebsd.org> Resent-Message-ID: <201001282250.o0SMoBdm035675@freefall.freebsd.org>
index | next in thread | raw e-mail
>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@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:help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001282242.o0SMgUpn074249>
