]> granicus.if.org Git - python/commitdiff
Issue #25301: Fix compatibility with ISO C90
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Oct 2015 11:49:26 +0000 (13:49 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Oct 2015 11:49:26 +0000 (13:49 +0200)
Objects/unicodeobject.c

index 56614e6b8d9bae61450024c922eacaadaa7c5fc9..3d7840403c1dc648a8cd94452f693c0d7a4d83f3 100644 (file)
@@ -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(