summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-07-16 14:30:28 (GMT)
committerGuido van Rossum <guido@python.org>2002-07-16 14:30:28 (GMT)
commit03013a0130285c21bb940c89f0538f8ed1d35622 (patch)
treeb92cc168af74f6fce6a0e7d188118b5fb633ca83
parentc0e35158fbe7f9f4920c283e31b29ac04a09faf5 (diff)
downloadcpython-03013a0130285c21bb940c89f0538f8ed1d35622.zip
cpython-03013a0130285c21bb940c89f0538f8ed1d35622.tar.gz
cpython-03013a0130285c21bb940c89f0538f8ed1d35622.tar.bz2
valid_identifier(): use an unsigned char* so that isalpha() will do
the right thing even if char is unsigned.
-rw-r--r--Objects/typeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a7afa9b..a7263d8 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -962,7 +962,7 @@ static PyObject *bozo_obj = NULL;
static int
valid_identifier(PyObject *s)
{
- char *p;
+ unsigned char *p;
int i, n;
if (!PyString_Check(s)) {
@@ -970,7 +970,7 @@ valid_identifier(PyObject *s)
"__slots__ must be strings");
return 0;
}
- p = PyString_AS_STRING(s);
+ p = (unsigned char *) PyString_AS_STRING(s);
n = PyString_GET_SIZE(s);
/* We must reject an empty name. As a hack, we bump the
length to 1 so that the loop will balk on the trailing \0. */