Mercurial > cpython-lru_cache-weakref
diff Python/strtod.c @ 548:83046664160e legacy-trunk
Clear errno, just to be sure.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 31 Dec 1991 13:15:19 +0000 |
| parents | b46d76ebd9a7 |
| children | f9cdeebfcb67 |
line wrap: on
line diff
--- a/Python/strtod.c Tue Dec 31 13:14:48 1991 +0000 +++ b/Python/strtod.c Tue Dec 31 13:15:19 1991 +0000 @@ -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 @@ char *p; char **pp; { + double res; + if (pp) *pp = p + strlen(p); - return atof(p); + res = atof(p); + errno = 0; + return res; + }
