diff options
Diffstat (limited to 'Python/strtod.c')
-rw-r--r-- | Python/strtod.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Python/strtod.c b/Python/strtod.c index d41b6908d0..e3fb81b921 100644 --- a/Python/strtod.c +++ b/Python/strtod.c @@ -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; + } |