diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-12-30 03:34:46 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-12-30 03:34:46 +0000 |
| commit | f7388e0d3854026958e676c31ab50dc06e797f08 (patch) | |
| tree | 4aa0c4f3355219f0fd3e65a25e922b69f3f9523e | |
| parent | 236f9adc7826e5c51300de4a7093082695ca0704 (diff) | |
Notes
| -rw-r--r-- | lib/libc/stdlib/atof.3 | 6 | ||||
| -rw-r--r-- | lib/libc/stdlib/atof.c | 9 | ||||
| -rw-r--r-- | lib/libc/stdlib/atoi.3 | 6 | ||||
| -rw-r--r-- | lib/libc/stdlib/atoi.c | 8 | ||||
| -rw-r--r-- | lib/libc/stdlib/atol.3 | 12 | ||||
| -rw-r--r-- | lib/libc/stdlib/atol.c | 9 | ||||
| -rw-r--r-- | lib/libc/stdlib/atoll.c | 9 |
7 files changed, 12 insertions, 47 deletions
diff --git a/lib/libc/stdlib/atof.3 b/lib/libc/stdlib/atof.3 index ad865f4e7e40..6ae984639a25 100644 --- a/lib/libc/stdlib/atof.3 +++ b/lib/libc/stdlib/atof.3 @@ -64,8 +64,6 @@ It is equivalent to: strtod(nptr, (char **)NULL); .Ed .Pp -except the handling of errors. -.Pp The decimal point character is defined in the program's locale (category .Dv LC_NUMERIC ) . @@ -80,9 +78,9 @@ function has been deprecated by .Fn strtod and should not be used in new code. .Sh ERRORS -The +The function .Fn atof -function does not detect errors. +need not affect the value of errno on an error. .Sh SEE ALSO .Xr atoi 3 , .Xr atol 3 , diff --git a/lib/libc/stdlib/atof.c b/lib/libc/stdlib/atof.c index e6dffa9184d4..0de674f2f272 100644 --- a/lib/libc/stdlib/atof.c +++ b/lib/libc/stdlib/atof.c @@ -37,18 +37,11 @@ static char sccsid[] = "@(#)atof.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include <errno.h> #include <stdlib.h> double atof(ascii) const char *ascii; { - double r; - int saverr; - - saverr = errno; - r = strtod(ascii, (char **)NULL); - errno = saverr; - return r; + return strtod(ascii, (char **)NULL); } diff --git a/lib/libc/stdlib/atoi.3 b/lib/libc/stdlib/atoi.3 index 551fc560888f..360faf779227 100644 --- a/lib/libc/stdlib/atoi.3 +++ b/lib/libc/stdlib/atoi.3 @@ -63,8 +63,6 @@ It is equivalent to: .Bd -literal -offset indent (int)strtol(nptr, (char **)NULL, 10); .Ed -.Pp -except the handling of errors. .Sh IMPLEMENTATION NOTES The .Fn atoi @@ -76,9 +74,9 @@ function has been deprecated by .Fn strtol and should not be used in new code. .Sh ERRORS -The +The function .Fn atoi -function does not detect errors. +need not affect the value of errno on an error. .Sh SEE ALSO .Xr atof 3 , .Xr atol 3 , diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c index 8e98a96e7111..17c91c1caddb 100644 --- a/lib/libc/stdlib/atoi.c +++ b/lib/libc/stdlib/atoi.c @@ -37,17 +37,11 @@ static char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include <errno.h> #include <stdlib.h> int atoi(str) const char *str; { - int r, saverr; - - saverr = errno; - r = (int)strtol(str, (char **)NULL, 10); - errno = saverr; - return r; + return (int)strtol(str, (char **)NULL, 10); } diff --git a/lib/libc/stdlib/atol.3 b/lib/libc/stdlib/atol.3 index 261999fdb9ed..0dceeecfe1d1 100644 --- a/lib/libc/stdlib/atol.3 +++ b/lib/libc/stdlib/atol.3 @@ -70,8 +70,6 @@ It is equivalent to: .Pp .Dl "strtol(nptr, (char **)NULL, 10);" .Pp -except the handling of errors. -.Pp The .Fn atoll function converts the initial portion of the string pointed to by @@ -84,15 +82,13 @@ representation. It is equivalent to: .Pp .Dl "strtoll(nptr, (char **)NULL, 10);" -.Pp -except the handling of errors. .Sh ERRORS -The +The functions .Fn atol -function does not detect errors. -The +and .Fn atoll -function does not detect errors. +need not +affect the value of errno on an error. .Sh SEE ALSO .Xr atof 3 , .Xr atoi 3 , diff --git a/lib/libc/stdlib/atol.c b/lib/libc/stdlib/atol.c index b85b8b2648da..d2e3c459dfa3 100644 --- a/lib/libc/stdlib/atol.c +++ b/lib/libc/stdlib/atol.c @@ -37,18 +37,11 @@ static char sccsid[] = "@(#)atol.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include <errno.h> #include <stdlib.h> long atol(str) const char *str; { - long r; - int saverr; - - saverr = errno; - r = strtol(str, (char **)NULL, 10); - errno = saverr; - return r; + return strtol(str, (char **)NULL, 10); } diff --git a/lib/libc/stdlib/atoll.c b/lib/libc/stdlib/atoll.c index c0a7212f5106..a3c15a2410d8 100644 --- a/lib/libc/stdlib/atoll.c +++ b/lib/libc/stdlib/atoll.c @@ -33,18 +33,11 @@ * $FreeBSD$ */ -#include <errno.h> #include <stdlib.h> long long atoll(str) const char *str; { - long long r; - int saverr; - - saverr = errno; - r = strtoll(str, (char **)NULL, 10); - errno = saverr; - return r; + return strtoll(str, (char **)NULL, 10); } |
