summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormillert <>2007-06-29 18:54:37 +0000
committermillert <>2007-06-29 18:54:37 +0000
commitac1bccf636517190eaf1cc13a79548688a38c6ea (patch)
treede9954f9d4bd2681aef331c50fc46ba688ac0390
parent84283cef03fc33c8bf96c1e48567804c12b9b670 (diff)
downloadopenbsd-ac1bccf636517190eaf1cc13a79548688a38c6ea.tar.gz
openbsd-ac1bccf636517190eaf1cc13a79548688a38c6ea.tar.bz2
openbsd-ac1bccf636517190eaf1cc13a79548688a38c6ea.zip
Document behavior when no conversion could be performed. Adapted
from FreeBSD. With help from jmc@.
-rw-r--r--src/lib/libc/stdlib/strtol.312
-rw-r--r--src/lib/libc/stdlib/strtoul.310
2 files changed, 17 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/strtol.3 b/src/lib/libc/stdlib/strtol.3
index 74361671ff..4eb767885b 100644
--- a/src/lib/libc/stdlib/strtol.3
+++ b/src/lib/libc/stdlib/strtol.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strtol.3,v 1.17 2007/05/31 19:19:31 jmc Exp $ 32.\" $OpenBSD: strtol.3,v 1.18 2007/06/29 18:54:37 millert Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: June 29 2007 $
35.Dt STRTOL 3 35.Dt STRTOL 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -151,8 +151,14 @@ The
151.Fn strtoimax , 151.Fn strtoimax ,
152and 152and
153.Fn strtoq 153.Fn strtoq
154functions returns the result of the conversion, 154functions return the result of the conversion,
155unless the value would underflow or overflow. 155unless the value would underflow or overflow.
156If no conversion could be performed, 0 is returned;
157the global variable
158.Va errno
159is also set to
160.Er EINVAL,
161though this is not portable across all platforms.
156If overflow or underflow occurs, 162If overflow or underflow occurs,
157.Va errno 163.Va errno
158is set to 164is set to
diff --git a/src/lib/libc/stdlib/strtoul.3 b/src/lib/libc/stdlib/strtoul.3
index 4e7fb641bc..30a09aa289 100644
--- a/src/lib/libc/stdlib/strtoul.3
+++ b/src/lib/libc/stdlib/strtoul.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: strtoul.3,v 1.17 2007/05/31 19:19:32 jmc Exp $ 32.\" $OpenBSD: strtoul.3,v 1.18 2007/06/29 18:54:37 millert Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: June 29 2007 $
35.Dt STRTOUL 3 35.Dt STRTOUL 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -175,6 +175,12 @@ and the global variable
175.Va errno 175.Va errno
176is set to 176is set to
177.Er ERANGE . 177.Er ERANGE .
178If no conversion could be performed, 0 is returned;
179the global variable
180.Va errno
181is also set to
182.Er EINVAL,
183though this is not portable across all platforms.
178.Pp 184.Pp
179There is no way to determine if 185There is no way to determine if
180.Fn strtoul 186.Fn strtoul