]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF bug #1072182: bad arg type to isspace in struct module
authorRaymond Hettinger <python@rcn.com>
Fri, 26 Aug 2005 08:42:13 +0000 (08:42 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 26 Aug 2005 08:42:13 +0000 (08:42 +0000)
Modules/structmodule.c

index 33134e920b7e33eb17317848389da0db4c1a12c1..137b8988e041c7ad1db5ce67efae0cbfabf392f1 100644 (file)
@@ -959,7 +959,7 @@ calcsize(const char *fmt, const formatdef *f)
        s = fmt;
        size = 0;
        while ((c = *s++) != '\0') {
-               if (isspace((int)c))
+               if (isspace(Py_CHARMASK(c)))
                        continue;
                if ('0' <= c && c <= '9') {
                        num = c - '0';
@@ -1059,7 +1059,7 @@ struct_pack(PyObject *self, PyObject *args)
        res = restart = PyString_AsString(result);
 
        while ((c = *s++) != '\0') {
-               if (isspace((int)c))
+               if (isspace(Py_CHARMASK(c)))
                        continue;
                if ('0' <= c && c <= '9') {
                        num = c - '0';
@@ -1191,7 +1191,7 @@ struct_unpack(PyObject *self, PyObject *args)
        str = start;
        s = fmt;
        while ((c = *s++) != '\0') {
-               if (isspace((int)c))
+               if (isspace(Py_CHARMASK(c)))
                        continue;
                if ('0' <= c && c <= '9') {
                        num = c - '0';