Skip to content

Commit

Permalink
make sure the buff can be written
Browse files Browse the repository at this point in the history
Signed-off-by: chenchen.ccqy66 <[email protected]>
  • Loading branch information
chenchen.ccqy66 committed Jun 24, 2022
1 parent 1c59d17 commit 123a997
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bfe_bufio/bufio.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ func (b *Reader) fill() {
b.w -= b.r
b.r = 0
}

// make sure the buff can be written
if b.w >= len(b.buf) {
return
}
// Read new data.
n, err := b.rd.Read(b.buf[b.w:])
if n < 0 {
Expand Down

0 comments on commit 123a997

Please sign in to comment.