From: Guido van Rossum Date: Mon, 22 Feb 1999 16:18:44 +0000 (+0000) Subject: In atoi(), don't use isxdigit() to test whether the last character X-Git-Tag: v1.5.2c1~284 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5bd69db9f03ef1fa5ccaefd6ddd43291f9e7532c;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index 234a4dd42bed..4b8a501c3161 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++;