]> granicus.if.org Git - python/commitdiff
Conrad Huang points out that "if (0 < ch < 256)", while legal C,
authorGuido van Rossum <guido@python.org>
Thu, 6 Apr 2000 18:18:10 +0000 (18:18 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 6 Apr 2000 18:18:10 +0000 (18:18 +0000)
doesn't mean what the Python programmer thought...

Objects/unicodeobject.c

index b876f342fd76e784a401e6477547062792553545..e4bbcff20cb0548ab700c167d78fa427663c5eaa 100644 (file)
@@ -1958,7 +1958,7 @@ int PyUnicode_EncodeDecimal(Py_UNICODE *s,
            *output++ = '0' + decimal;
            continue;
        }
-       if (0 < ch < 256) {
+       if (0 < ch && ch < 256) {
            *output++ = (char) ch;
            continue;
        }