diff options
| author | deraadt <> | 1999-09-13 07:14:13 +0000 |
|---|---|---|
| committer | deraadt <> | 1999-09-13 07:14:13 +0000 |
| commit | 4fbe3f20ecbd74a298ba0cc4b8105b098f93b6ea (patch) | |
| tree | 77457b7ccaeff0978081b4be8be10c1b35b925d2 /src/lib/libc/stdlib/atoi.3 | |
| parent | 03c5bd443995fbd8e7f9376ee4f83dab9f8db072 (diff) | |
| download | openbsd-4fbe3f20ecbd74a298ba0cc4b8105b098f93b6ea.tar.gz openbsd-4fbe3f20ecbd74a298ba0cc4b8105b098f93b6ea.tar.bz2 openbsd-4fbe3f20ecbd74a298ba0cc4b8105b098f93b6ea.zip | |
use stronger language when pointing people at strtol()
Diffstat (limited to 'src/lib/libc/stdlib/atoi.3')
| -rw-r--r-- | src/lib/libc/stdlib/atoi.3 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/atoi.3 b/src/lib/libc/stdlib/atoi.3 index fa7b84e95c..80831bdd2f 100644 --- a/src/lib/libc/stdlib/atoi.3 +++ b/src/lib/libc/stdlib/atoi.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: atoi.3,v 1.3 1999/06/29 18:36:18 aaron Exp $ | 36 | .\" $OpenBSD: atoi.3,v 1.4 1999/09/13 07:14:13 deraadt Exp $ |
| 37 | .\" | 37 | .\" |
| 38 | .Dd June 4, 1993 | 38 | .Dd June 4, 1993 |
| 39 | .Dt ATOI 3 | 39 | .Dt ATOI 3 |
| @@ -60,6 +60,17 @@ It is equivalent to: | |||
| 60 | .Bd -literal -offset indent | 60 | .Bd -literal -offset indent |
| 61 | (int)strtol(nptr, (char **)NULL, 10); | 61 | (int)strtol(nptr, (char **)NULL, 10); |
| 62 | .Ed | 62 | .Ed |
| 63 | .Sh CAVEATS | ||
| 64 | .Nm | ||
| 65 | does no overflow checking, handles unsigned numbers poorly, | ||
| 66 | and handles strings containing trailing extra characters | ||
| 67 | (like | ||
| 68 | .Dq "123abc" Ns ) | ||
| 69 | poorly. Careful use of | ||
| 70 | .Xr strtol 3 | ||
| 71 | and | ||
| 72 | .Xr strtoul 3 | ||
| 73 | can alleviate these problems. | ||
| 63 | .Sh SEE ALSO | 74 | .Sh SEE ALSO |
| 64 | .Xr atof 3 , | 75 | .Xr atof 3 , |
| 65 | .Xr atol 3 , | 76 | .Xr atol 3 , |
