mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes.Buffer.ReadFrom: fix bug.
Fixes #852. R=rsc CC=golang-dev https://golang.org/cl/1680042
This commit is contained in:
parent
6c08859b0e
commit
9baa7a51ba
1 changed files with 1 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ func (b *Buffer) ReadFrom(r io.Reader) (n int64, err os.Error) {
|
|||
b.off = 0
|
||||
}
|
||||
m, e := r.Read(b.buf[len(b.buf):cap(b.buf)])
|
||||
b.buf = b.buf[b.off : len(b.buf)+m]
|
||||
b.buf = b.buf[0 : len(b.buf)+m]
|
||||
n += int64(m)
|
||||
if e == os.EOF {
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue