diff --git a/src/lib/libc/stdlib/atoi.3 b/src/lib/libc/stdlib/atoi.3 index fa7b84e9..80831bdd 100644 --- a/src/lib/libc/stdlib/atoi.3 +++ b/src/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 ,