Commit 5bd69db9 authored by Guido van Rossum's avatar Guido van Rossum

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.
parent 0fb7a376
......@@ -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++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment