Bug #1417699: Reject locale-specific decimal point in float()

and atof().
This commit is contained in:
Martin v. Löwis 2006-07-03 12:19:50 +00:00
parent 82c276ea33
commit fcfff0a7fa
4 changed files with 27 additions and 3 deletions

View file

@ -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 */
}