diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-10-05 11:49:26 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-10-05 11:49:26 (GMT) |
commit | 74e8fac3c844796bdef5fccfa345784258b899e9 (patch) | |
tree | 2ef7053a467be727af5f988df67cb2a3b5cd2baf | |
parent | 1d65d9192dac57776693c55a9ccefbde2ca74c23 (diff) | |
download | cpython-74e8fac3c844796bdef5fccfa345784258b899e9.zip cpython-74e8fac3c844796bdef5fccfa345784258b899e9.tar.gz cpython-74e8fac3c844796bdef5fccfa345784258b899e9.tar.bz2 |
Issue #25301: Fix compatibility with ISO C90
-rw-r--r-- | Objects/unicodeobject.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 56614e6..3d78404 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -4795,9 +4795,12 @@ PyUnicode_DecodeUTF8Stateful(const char *s, break; case _Py_ERROR_SURROGATEESCAPE: + { + Py_ssize_t i; + if (_PyUnicodeWriter_PrepareKind(&writer, PyUnicode_2BYTE_KIND) < 0) goto onError; - for (Py_ssize_t i=startinpos; i<endinpos; i++) { + for (i=startinpos; i<endinpos; i++) { ch = (Py_UCS4)(unsigned char)(starts[i]); PyUnicode_WRITE(writer.kind, writer.data, writer.pos, ch + 0xdc00); @@ -4805,6 +4808,7 @@ PyUnicode_DecodeUTF8Stateful(const char *s, } s += (endinpos - startinpos); break; + } default: if (unicode_decode_call_errorhandler_writer( |