]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clear errno, just to be sure.
authorGuido van Rossum <guido@python.org>
Tue, 31 Dec 1991 13:15:19 +0000 (13:15 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 31 Dec 1991 13:15:19 +0000 (13:15 +0000)
Python/strtod.c

index d41b6908d00ce74611cb7eb6d67405fe39fac03f..e3fb81b921b2b89f718097f8db00d63681ba2912 100644 (file)
@@ -1,6 +1,8 @@
 /* This is not a proper strtod() implementation, but sufficient for Python.
    Python won't detect floating point constant overflow, though. */
 
+extern int errno;
+
 extern int strlen();
 extern double atof();
 
@@ -9,7 +11,12 @@ strtod(p, pp)
        char *p;
        char **pp;
 {
+       double res;
+
        if (pp)
                *pp = p + strlen(p);
-       return atof(p);
+       res = atof(p);
+       errno = 0;
+       return res;
+       
 }