diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2006-07-03 12:19:50 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2006-07-03 12:19:50 +0000 |
commit | 38a4852a011a92b6469f45323e400c132aa19db0 (patch) | |
tree | 5b4ed26c7c8496dad7771c69e41e332c6747b1a4 /Python/pystrtod.c | |
parent | 5f463b4b12dcdeadce99dfaf8d7cc954b770f636 (diff) | |
download | cpython-38a4852a011a92b6469f45323e400c132aa19db0.tar.gz |
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
Diffstat (limited to 'Python/pystrtod.c')
-rw-r--r-- | Python/pystrtod.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c index e1c84ea03e..6c19b45fd2 100644 --- a/Python/pystrtod.c +++ b/Python/pystrtod.c @@ -90,6 +90,13 @@ PyOS_ascii_strtod(const char *nptr, char **endptr) p++; end = p; } + else if (strncmp(p, decimal_point, decimal_point_len) == 0) + { + /* Python bug #1417699 */ + *endptr = (char*)nptr; + errno = EINVAL; + return val; + } /* For the other cases, we need not convert the decimal point */ } |