diff --git a/lib/std/io/stream/buffer.c3 b/lib/std/io/stream/buffer.c3 index b3a0a8dc7..eb44bc3c8 100644 --- a/lib/std/io/stream/buffer.c3 +++ b/lib/std/io/stream/buffer.c3 @@ -121,9 +121,9 @@ fn usz! WriteBuffer.write(&self, char[] bytes) @dynamic fn void! WriteBuffer.write_byte(&self, char c) @dynamic { usz n = self.bytes.len - self.index - 1; - if (n == 0) { + if (n == 0) + { self.write_pending()!; - self.index = 0; } self.bytes[self.index] = c; self.index += 1; diff --git a/releasenotes.md b/releasenotes.md index f675f8d78..4d73504a6 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -6,6 +6,7 @@ ### Fixes - Fix bug where `a > 0 ? f() : g()` could cause a compiler crash if both returned `void!`. +- Fix issue writing a single byte in the WriteBuffer ### Stdlib changes