From e83b982afe103544112dea83e1befe1061f9ea93 Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Mon, 19 Aug 2024 04:03:40 -0400 Subject: [PATCH] Measure `bytes.Buffer` size by `length` instead of `capacity` --- core/bytes/buffer.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/bytes/buffer.odin b/core/bytes/buffer.odin index 4208b0d46..0399beea4 100644 --- a/core/bytes/buffer.odin +++ b/core/bytes/buffer.odin @@ -419,7 +419,7 @@ _buffer_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offse n, err = buffer_seek(b, offset, whence) return case .Size: - n = i64(buffer_capacity(b)) + n = i64(buffer_length(b)) return case .Destroy: buffer_destroy(b)