From: Guido van Rossum Date: Thu, 6 Apr 2000 18:18:10 +0000 (+0000) Subject: Conrad Huang points out that "if (0 < ch < 256)", while legal C, X-Git-Tag: v1.6a2~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba47704943137318229ad9a4bba6a93aa0ba1d29;p=python Conrad Huang points out that "if (0 < ch < 256)", while legal C, doesn't mean what the Python programmer thought... --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index b876f342fd..e4bbcff20c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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; }