summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 00:54:19 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 00:54:19 (GMT)
commit975134e2a233db5d7a28de63d0e4047894379490 (patch)
treeb2f628f78fec92997a89c7319ce994fb1588a08b /Objects
parent5aa7df320f35cb0d5acb81ff313b1cc02480c9b8 (diff)
downloadcpython-975134e2a233db5d7a28de63d0e4047894379490.zip
cpython-975134e2a233db5d7a28de63d0e4047894379490.tar.gz
cpython-975134e2a233db5d7a28de63d0e4047894379490.tar.bz2
Issue #13093: Fix error handling on PyUnicode_EncodeDecimal()
Add tests for PyUnicode_EncodeDecimal()
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 5ce879d..8225e82 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5160,11 +5160,10 @@ int PyUnicode_EncodeDecimal(Py_UNICODE *s,
}
/* All other characters are considered unencodable */
collstart = p;
- collend = p+1;
- while (collend < end) {
+ for (collend = p+1; collend < end; collend++) {
if ((0 < *collend && *collend < 256) ||
- !Py_UNICODE_ISSPACE(*collend) ||
- Py_UNICODE_TODECIMAL(*collend))
+ Py_UNICODE_ISSPACE(*collend) ||
+ 0 <= Py_UNICODE_TODECIMAL(*collend))
break;
}
/* cache callback name lookup