Skip to content

Commit

Permalink
improved EOF handling in buffer.readNext
Browse files Browse the repository at this point in the history
  • Loading branch information
arnehormann committed Jul 11, 2013
1 parent f82b14f commit 035e985
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func (b *buffer) readNext(need int) (p []byte, err error) {
if b.length < need {
// refill
err = b.fill(need) // err deferred
if err == io.EOF && b.length >= need {
err = nil
}
}

p = b.buf[b.idx : b.idx+need]
Expand Down

0 comments on commit 035e985

Please sign in to comment.