Date: Wed, 26 Nov 2008 00:05:08 GMT From: Stephen Hurd <shurd@sasktel.net> To: freebsd-gnats-submit@FreeBSD.org Subject: docs/129196: Inconsistent errno in strtol() Message-ID: <200811260005.mAQ058Is091716@www.freebsd.org> Resent-Message-ID: <200811260010.mAQ0A0pM041323@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 129196 >Category: docs >Synopsis: Inconsistent errno in strtol() >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Nov 26 00:10:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Stephen Hurd >Release: 7.0-RELEASE >Organization: >Environment: FreeBSD server.hurd.local 7.0-RELEASE FreeBSD 7.0-RELEASE #4: Mon Mar 10 23:00:02 PDT 2008 admin@server.hurd.local:/usr/obj/usr/src/sys/SERVER i386 >Description: ``strtol("0", NULL, 0);'' and ``strtol("0x", NULL, 0);'' return zero and does not set errno, but ``strtol("", NULL, 0);'' does. Since the documentation says that an octal value is /0?([0-7]+)/ and a hex value is /(?:0x)?([0-9a-zA-Z])/ in none of the cases can a conversion be performed. At least SUSv2 states that EINVAL indicates an invalid base argument, not an invalid nptr argument (I don't have the other standards available) so all of those examples should be consistent with each other (most likely not setting errno). >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811260005.mAQ058Is091716>