mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
In atoi(), don't use isxdigit() to test whether the last character
converted was a "digit" -- use isalnum(). This test is there only to guard against "+" or "-" being interpreted as a valid int literal. Reported by Takahiro Nakayama.
This commit is contained in:
parent
0fb7a37667
commit
5bd69db9f0
1 changed files with 1 additions and 1 deletions
|
@ -818,7 +818,7 @@ strop_atoi(self, args)
|
|||
x = (long) PyOS_strtoul(s, &end, base);
|
||||
else
|
||||
x = PyOS_strtol(s, &end, base);
|
||||
if (end == s || !isxdigit(end[-1]))
|
||||
if (end == s || !isalnum(end[-1]))
|
||||
goto bad;
|
||||
while (*end && isspace(Py_CHARMASK(*end)))
|
||||
end++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue