From 69e74b6332cd376056cf02d8d460bd9538f65807 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 14 Nov 2024 00:05:23 +0100 Subject: [PATCH] Formatting, releasenotes. --- lib/std/io/stream/buffer.c3 | 4 ++-- releasenotes.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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