summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtoul.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/strtoul.3')
-rw-r--r--src/lib/libc/stdlib/strtoul.328
1 files changed, 10 insertions, 18 deletions
diff --git a/src/lib/libc/stdlib/strtoul.3 b/src/lib/libc/stdlib/strtoul.3
index 572658bf7f..e090253566 100644
--- a/src/lib/libc/stdlib/strtoul.3
+++ b/src/lib/libc/stdlib/strtoul.3
@@ -33,7 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: strtoul.3,v 1.6 2000/03/04 22:19:31 aaron Exp $ 36.\" $OpenBSD: strtoul.3,v 1.7 2000/04/20 13:50:03 aaron Exp $
37.\" 37.\"
38.Dd June 25, 1992 38.Dd June 25, 1992
39.Dt STRTOUL 3 39.Dt STRTOUL 3
@@ -55,16 +55,14 @@
55.Sh DESCRIPTION 55.Sh DESCRIPTION
56The 56The
57.Fn strtoul 57.Fn strtoul
58function 58function converts the string in
59converts the string in
60.Fa nptr 59.Fa nptr
61to an 60to an
62.Li unsigned long 61.Li unsigned long
63value. 62value.
64The 63The
65.Fn strtouq 64.Fn strtouq
66function 65function converts the string in
67converts the string in
68.Fa nptr 66.Fa nptr
69to a 67to a
70.Li u_quad_t 68.Li u_quad_t
@@ -84,11 +82,9 @@ or
84sign. 82sign.
85If 83If
86.Fa base 84.Fa base
87is zero or 16, 85is zero or 16, the string may then include a
88the string may then include a
89.Ql 0x 86.Ql 0x
90prefix, 87prefix, and the number will be read in base 16; otherwise, a zero
91and the number will be read in base 16; otherwise, a zero
92.Fa base 88.Fa base
93is taken as 10 (decimal) unless the next character is 89is taken as 10 (decimal) unless the next character is
94.Ql 0 , 90.Ql 0 ,
@@ -96,14 +92,12 @@ in which case it is taken as 8 (octal).
96.Pp 92.Pp
97The remainder of the string is converted to an 93The remainder of the string is converted to an
98.Li unsigned long 94.Li unsigned long
99value in the obvious manner, 95value in the obvious manner, stopping at the end of the string
100stopping at the end of the string
101or at the first character that does not produce a valid digit 96or at the first character that does not produce a valid digit
102in the given base. 97in the given base.
103(In bases above 10, the letter 98(In bases above 10, the letter
104.Ql A 99.Ql A
105in either upper or lower case 100in either upper or lower case represents 10,
106represents 10,
107.Ql B 101.Ql B
108represents 11, and so forth, with 102represents 11, and so forth, with
109.Ql Z 103.Ql Z
@@ -111,7 +105,7 @@ representing 35.)
111.Pp 105.Pp
112If 106If
113.Fa endptr 107.Fa endptr
114is non nil, 108is non-null,
115.Fn strtoul 109.Fn strtoul
116stores the address of the first invalid character in 110stores the address of the first invalid character in
117.Fa *endptr . 111.Fa *endptr .
@@ -133,8 +127,7 @@ on return, the entire string was valid.)
133.Sh RETURN VALUES 127.Sh RETURN VALUES
134The 128The
135.Fn strtoul 129.Fn strtoul
136function 130function returns the result of the conversion,
137returns the result of the conversion,
138unless the value would overflow, in which case 131unless the value would overflow, in which case
139.Dv ULONG_MAX 132.Dv ULONG_MAX
140is returned and 133is returned and
@@ -206,8 +199,7 @@ The given string was out of range; the value converted has been clamped.
206.Sh STANDARDS 199.Sh STANDARDS
207The 200The
208.Fn strtoul 201.Fn strtoul
209function 202function conforms to
210conforms to
211.St -ansiC . 203.St -ansiC .
212.Sh BUGS 204.Sh BUGS
213Ignores the current locale. 205Ignores the current locale.