The following reply was made to PR standards/129196; it has been noted by GNATS.
From: Jilles Tjoelker <
jilles@...>
To:
bug-followup@...,
shurd@...
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
_______________________________________________
freebsd-standards@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-standardsTo unsubscribe, send any mail to "
freebsd-standards-unsubscribe@..."