Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index fd5061b178af360ff5941f7e25163ac14b611d9c..8eadaedec9efb67859d1fc402bd66c82b351e6d8 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -5732,11 +5732,11 @@ static void StreamToConsumer(Dart_StreamConsumer consumer, |
user_data); |
// Stream out data. Skipping the array characters. |
+ // Replace array close with '\0'. |
+ output[output_length - 2] = '\0'; |
intptr_t cursor = 1; |
output_length -= 1; |
intptr_t remaining = output_length - 1; |
- // Replace array close with '\0'. |
- output[output_length - 2] = '\0'; |
while (remaining >= kDataSize) { |
consumer(Dart_StreamConsumer_kData, |