Browse Source

Document behavior when no conversion could be performed. Adapted

from FreeBSD.  With help from jmc@.
OPENBSD_4_2
millert 17 years ago
parent
commit
1b911c12d6
2 changed files with 17 additions and 5 deletions
  1. +9
    -3
      src/lib/libc/stdlib/strtol.3
  2. +8
    -2
      src/lib/libc/stdlib/strtoul.3

+ 9
- 3
src/lib/libc/stdlib/strtol.3 View File

@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" $OpenBSD: strtol.3,v 1.17 2007/05/31 19:19:31 jmc Exp $
.\" $OpenBSD: strtol.3,v 1.18 2007/06/29 18:54:37 millert Exp $
.\" .\"
.Dd $Mdocdate: May 31 2007 $
.Dd $Mdocdate: June 29 2007 $
.Dt STRTOL 3 .Dt STRTOL 3
.Os .Os
.Sh NAME .Sh NAME
@ -151,8 +151,14 @@ The
.Fn strtoimax , .Fn strtoimax ,
and and
.Fn strtoq .Fn strtoq
functions returns the result of the conversion,
functions return the result of the conversion,
unless the value would underflow or overflow. unless the value would underflow or overflow.
If no conversion could be performed, 0 is returned;
the global variable
.Va errno
is also set to
.Er EINVAL,
though this is not portable across all platforms.
If overflow or underflow occurs, If overflow or underflow occurs,
.Va errno .Va errno
is set to is set to


+ 8
- 2
src/lib/libc/stdlib/strtoul.3 View File

@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE. .\" SUCH DAMAGE.
.\" .\"
.\" $OpenBSD: strtoul.3,v 1.17 2007/05/31 19:19:32 jmc Exp $
.\" $OpenBSD: strtoul.3,v 1.18 2007/06/29 18:54:37 millert Exp $
.\" .\"
.Dd $Mdocdate: May 31 2007 $
.Dd $Mdocdate: June 29 2007 $
.Dt STRTOUL 3 .Dt STRTOUL 3
.Os .Os
.Sh NAME .Sh NAME
@ -175,6 +175,12 @@ and the global variable
.Va errno .Va errno
is set to is set to
.Er ERANGE . .Er ERANGE .
If no conversion could be performed, 0 is returned;
the global variable
.Va errno
is also set to
.Er EINVAL,
though this is not portable across all platforms.
.Pp .Pp
There is no way to determine if There is no way to determine if
.Fn strtoul .Fn strtoul


Loading…
Cancel
Save