diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-12-25 04:10:50 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-12-25 04:10:50 +0000 |
commit | b12990ca585044c567abc2cfbea6c019b0b21dac (patch) | |
tree | f459d8eef7a900e7333840ef9c570e9ce81b1125 /lib/libc/stdlib/atof.c | |
parent | 9dd4281db826fdae02215c9d4237d18e80d38489 (diff) |
Notes
Diffstat (limited to 'lib/libc/stdlib/atof.c')
-rw-r--r-- | lib/libc/stdlib/atof.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libc/stdlib/atof.c b/lib/libc/stdlib/atof.c index 130e2858f926..e6dffa9184d4 100644 --- a/lib/libc/stdlib/atof.c +++ b/lib/libc/stdlib/atof.c @@ -29,18 +29,26 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)atof.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ +#include <errno.h> #include <stdlib.h> -#include <stddef.h> double atof(ascii) const char *ascii; { - return (strtod(ascii, NULL)); + double r; + int saverr; + + saverr = errno; + r = strtod(ascii, (char **)NULL); + errno = saverr; + return r; } |