Skip to content

Commit

Permalink
fix length calculation in bufferToBytesReader.WriteTo
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Nov 3, 2017
1 parent 10712b3 commit 2f5d501
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/buf/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ func (r *bufferToBytesReader) writeToInternal(writer io.Writer) (int64, error) {
mbWriter := NewWriter(writer)
totalBytes := int64(0)
if r.leftOver != nil {
totalBytes += int64(r.leftOver.Len())
if err := mbWriter.Write(r.leftOver); err != nil {
return 0, err
}
totalBytes += int64(r.leftOver.Len())
}

for {
Expand Down

0 comments on commit 2f5d501

Please sign in to comment.