From 74e8fac3c844796bdef5fccfa345784258b899e9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 5 Oct 2015 13:49:26 +0200 Subject: Issue #25301: Fix compatibility with ISO C90 --- Objects/unicodeobject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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