diff options
author | Guido van Rossum <guido@python.org> | 1999-02-22 16:18:44 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-02-22 16:18:44 (GMT) |
commit | 5bd69db9f03ef1fa5ccaefd6ddd43291f9e7532c (patch) | |
tree | 0d676e2b08c42597e26f8c91e8b780ff9a95a822 /Modules | |
parent | 0fb7a37667e78f96392b5cfa6e82f04551724684 (diff) | |
download | cpython-5bd69db9f03ef1fa5ccaefd6ddd43291f9e7532c.zip cpython-5bd69db9f03ef1fa5ccaefd6ddd43291f9e7532c.tar.gz cpython-5bd69db9f03ef1fa5ccaefd6ddd43291f9e7532c.tar.bz2 |
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/stropmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index 234a4dd..4b8a501 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -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++; |