From: Guido van Rossum Date: Tue, 31 Dec 1991 13:15:19 +0000 (+0000) Subject: Clear errno, just to be sure. X-Git-Tag: v0.9.8~635 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5afc74757bae4a7274a5db0888985cd84ed92d32;p=thirdparty%2FPython%2Fcpython.git Clear errno, just to be sure. --- diff --git a/Python/strtod.c b/Python/strtod.c index d41b6908d00c..e3fb81b921b2 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; + }