commit 9ae566de930c1264b077d35fbda5156e5f6fdc26 parent a150d64f2f36fa60e836eecfd826fc1d6f13dcfa Author: Drew DeVault <sir@cmpwn.com> Date: Wed, 17 Mar 2021 11:34:05 -0400 bufio: fix partial consumption read buffer Diffstat:
M | bufio/buffered.ha | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bufio/buffered.ha b/bufio/buffered.ha @@ -117,7 +117,7 @@ fn buffered_read(s: *io::stream, buf: []u8) (size | io::EOF | io::error) = { buf[..n] = s.rfilled[..n]; s.rbuffer[..len(s.rbuffer) - n] = s.rbuffer[n..]; - s.rfilled = s.rfilled[n..]; + s.rfilled = s.rbuffer[..len(s.rfilled) - n]; return n; };