Commit 9baa7a51 authored by Rob Pike's avatar Rob Pike

bytes.Buffer.ReadFrom: fix bug.

Fixes #852.

R=rsc
CC=golang-dev
https://golang.org/cl/1680042
parent 6c08859b
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment