]> granicus.if.org Git - python/commitdiff
Use Py_CHARMASK for ctype macros. Fixes bug #232787.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 6 Mar 2001 12:12:02 +0000 (12:12 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 6 Mar 2001 12:12:02 +0000 (12:12 +0000)
Modules/timemodule.c
Objects/intobject.c
Python/errors.c

index c4a066f8301cbf5c80963f3cdf03642b5ca9272d..90886f289b78c0fe83bd053e7a46bd394bcf5131 100644 (file)
@@ -397,7 +397,7 @@ time_strptime(PyObject *self, PyObject *args)
                PyErr_SetString(PyExc_ValueError, "format mismatch");
                return NULL;
        }
-       while (*s && isspace(*s))
+       while (*s && isspace(Py_CHARMASK(*s)))
                s++;
        if (*s) {
                PyErr_Format(PyExc_ValueError,
index 72d5323bf0f4d0d51910bf2b399cad1579e8190f..9a1f0e625082964beb90e124150afa76c655d37b 100644 (file)
@@ -182,7 +182,7 @@ PyInt_FromString(char *s, char **pend, int base)
                x = (long) PyOS_strtoul(s, &end, base);
        else
                x = PyOS_strtol(s, &end, base);
-       if (end == s || !isalnum(end[-1]))
+       if (end == s || !isalnum(Py_CHARMASK(end[-1])))
                goto bad;
        while (*end && isspace(Py_CHARMASK(*end)))
                end++;
index 7f30f7ee0cc4cc33490c7b12b8abe5a056601b2d..8d02b8e262211e1cea562cac16cf578a9c9e1b46 100644 (file)
@@ -402,7 +402,7 @@ PyErr_Format(PyObject *exception, const char *format, ...)
        for (f = format; *f; f++) {
                if (*f == '%') {
                        const char* p = f;
-                       while (*++f && *f != '%' && !isalpha(*f))
+                       while (*++f && *f != '%' && !isalpha(Py_CHARMASK(*f)))
                                ;
                        switch (*f) {
                        case 'c':
@@ -457,15 +457,15 @@ PyErr_Format(PyObject *exception, const char *format, ...)
                        /* parse the width.precision part (we're only
                           interested in the precision value, if any) */
                        n = 0;
-                       while (isdigit(*f))
+                       while (isdigit(Py_CHARMASK(*f)))
                                n = (n*10) + *f++ - '0';
                        if (*f == '.') {
                                f++;
                                n = 0;
-                               while (isdigit(*f))
+                               while (isdigit(Py_CHARMASK(*f)))
                                        n = (n*10) + *f++ - '0';
                        }
-                       while (*f && *f != '%' && !isalpha(*f))
+                       while (*f && *f != '%' && !isalpha(Py_CHARMASK(*f)))
                                f++;
                        switch (*f) {
                        case 'c':