Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2009 18:50:07 GMT
From:      Jilles Tjoelker <jilles@stack.nl>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/129196: Inconsistent errno in strtol()
Message-ID:  <200908121850.n7CIo7AM090022@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/129196; it has been noted by GNATS.

From: Jilles Tjoelker <jilles@stack.nl>
To: bug-followup@FreeBSD.org, shurd@sasktel.net
Cc:  
Subject: Re: standards/129196: Inconsistent errno in strtol()
Date: Wed, 12 Aug 2009 20:45:25 +0200

 The behaviour seems fine to me.
 
 POSIX.1-2008 on
 http://www.opengroup.org/onlinepubs/9699919799/functions/strtol.html
 allows errno=EINVAL if no conversion could be performed (but the proper
 way to check this is via endptr).
 
 Common sense suggests that strtol("0", NULL, 0) be successful and return
 0, and in fact that is the case ("0" is an octal constant).
 
 "0x" should be interpreted as a subject sequence "0" followed by
 unrecognized sequence "x".
 
 -- 
 Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908121850.n7CIo7AM090022>