summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-09-13 07:14:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-09-13 07:14:14 +0000
commitc686447ef5edcc5e9c1ee8c9ef8d1af2ae3f8afc (patch)
treea10eb289343dff36cf24f4064f908f9a55dcf90c /lib/libc
parent32244ca4856ee717e790f916e1bd1de8d9c56519 (diff)
use stronger language when pointing people at strtol()
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/atoi.313
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libc/stdlib/atoi.3 b/lib/libc/stdlib/atoi.3
index fa7b84e95c9..80831bdd2fa 100644
--- a/lib/libc/stdlib/atoi.3
+++ b/lib/libc/stdlib/atoi.3
@@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: atoi.3,v 1.3 1999/06/29 18:36:18 aaron Exp $
+.\" $OpenBSD: atoi.3,v 1.4 1999/09/13 07:14:13 deraadt Exp $
.\"
.Dd June 4, 1993
.Dt ATOI 3
@@ -60,6 +60,17 @@ It is equivalent to:
.Bd -literal -offset indent
(int)strtol(nptr, (char **)NULL, 10);
.Ed
+.Sh CAVEATS
+.Nm
+does no overflow checking, handles unsigned numbers poorly,
+and handles strings containing trailing extra characters
+(like
+.Dq "123abc" Ns )
+poorly. Careful use of
+.Xr strtol 3
+and
+.Xr strtoul 3
+can alleviate these problems.
.Sh SEE ALSO
.Xr atof 3 ,
.Xr atol 3 ,