Skip to content

Commit

Permalink
fix reader from
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Aug 29, 2024
1 parent defb377 commit df928dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gojo/bufio/bufio.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,8 @@ struct Writer[W: io.Writer](Sized, io.Writer, io.ByteWriter, io.StringWriter, io
if err:
if bytes_written > 0 and bytes_written < self.bytes_written:
var temp = self.as_bytes_slice()[bytes_written : self.bytes_written]
_ = copy(self.buf.unsafe_ptr().offset(self.buf.size), temp.unsafe_ptr(), len(temp))
var copied_bytes = copy(self.buf.unsafe_ptr().offset(self.buf.size), temp.unsafe_ptr(), len(temp))
self.buf.size += copied_bytes

self.bytes_written -= bytes_written
self.err = err
Expand Down

0 comments on commit df928dc

Please sign in to comment.