1 --- strtol.3 2006-02-14 14:41:58.000000000 -0800
2 +++ strtol.3.edit 2006-08-09 13:42:57.000000000 -0700
7 -.Nm strtol , strtoll , strtoimax , strtoq
12 .Nd "convert a string value to a"
13 .Vt long , "long long" , intmax_t
22 +.Fa "const char *restrict str"
23 +.Fa "char **restrict endptr"
29 -.Fn strtol "const char * restrict nptr" "char ** restrict endptr" "int base"
31 +.Fa "const char *restrict str"
32 +.Fa "char **restrict endptr"
36 -.Fn strtoll "const char * restrict nptr" "char ** restrict endptr" "int base"
39 -.Fn strtoimax "const char * restrict nptr" "char ** restrict endptr" "int base"
41 +.Fa "const char *restrict str"
42 +.Fa "char **restrict endptr"
49 -.Fn strtoq "const char *nptr" "char **endptr" "int base"
51 +.Fa "const char *str"
59 converts the string in
68 converts the string in
77 converts the string in
86 converts the string in
93 If there were no digits at all, however,
95 stores the original value of
106 @@ -159,11 +177,17 @@
109 on return, the entire string was valid.)
111 +Extended locale versions of these functions are documented in
115 +for more information.
127 and the function return value is clamped according
128 to the following table.
129 -.Bl -column -offset indent ".Fn strtoimax" ".Sy overflow" ".Sy underflow"
130 -.It Sy Function Ta Sy overflow Ta Sy underflow
131 +.Bl -column -offset indent ".Fn strtoimax" ".Dv INTMAX_MIN" ".Dv INTMAX_MAX"
132 +.It Sy Function Ta Sy underflow Ta Sy overflow
133 .It Fn strtol Ta Dv LONG_MIN Ta Dv LONG_MAX
134 .It Fn strtoll Ta Dv LLONG_MIN Ta Dv LLONG_MAX
135 .It Fn strtoimax Ta Dv INTMAX_MIN Ta Dv INTMAX_MAX
136 @@ -199,13 +223,25 @@
138 The given string was out of range; the value converted has been clamped.
141 +.Fd #include <stdlib.h>
142 +.Fd #include <limits.h>
145 +is necessary for the