From 8251f4d7d009ce5f0e7d9293d70458971dd4c553 Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Mon, 19 Aug 2024 02:05:05 -0400 Subject: [PATCH] Return `.EOF` in `bytes.buffer_read_at` instead This is consistent with the other stream `read` procs --- 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 f46fb826a..995068aad 100644 --- a/core/bytes/buffer.odin +++ b/core/bytes/buffer.odin @@ -249,7 +249,7 @@ buffer_read_at :: proc(b: ^Buffer, p: []byte, offset: int) -> (n: int, err: io.E b.last_read = .Invalid if uint(offset) >= len(b.buf) { - err = .Invalid_Offset + err = .EOF return } n = copy(p, b.buf[offset:])