diff options
author | 2007-06-29 18:54:37 +0000 | |
---|---|---|
committer | 2007-06-29 18:54:37 +0000 | |
commit | ebe177505dc76ae7a913f5198d471682a0e0ed6c (patch) | |
tree | e8ce878589495fea75c7a0da7cbc2900e75447c5 /lib/libc/stdlib | |
parent | ansify/de-register (diff) | |
download | wireguard-openbsd-ebe177505dc76ae7a913f5198d471682a0e0ed6c.tar.xz wireguard-openbsd-ebe177505dc76ae7a913f5198d471682a0e0ed6c.zip |
Document behavior when no conversion could be performed. Adapted
from FreeBSD. With help from jmc@.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/strtol.3 | 12 | ||||
-rw-r--r-- | lib/libc/stdlib/strtoul.3 | 10 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lib/libc/stdlib/strtol.3 b/lib/libc/stdlib/strtol.3 index 74361671ffb..4eb767885ba 100644 --- a/lib/libc/stdlib/strtol.3 +++ b/lib/libc/stdlib/strtol.3 @@ -29,9 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" 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 .Os .Sh NAME @@ -151,8 +151,14 @@ The .Fn strtoimax , and .Fn strtoq -functions returns the result of the conversion, +functions return the result of the conversion, 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, .Va errno is set to diff --git a/lib/libc/stdlib/strtoul.3 b/lib/libc/stdlib/strtoul.3 index 4e7fb641bc4..30a09aa2891 100644 --- a/lib/libc/stdlib/strtoul.3 +++ b/lib/libc/stdlib/strtoul.3 @@ -29,9 +29,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" 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 .Os .Sh NAME @@ -175,6 +175,12 @@ and the global variable .Va errno is set to .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 There is no way to determine if .Fn strtoul |