]> Cypherpunks repositories - gostls13.git/commitdiff
bytes.Buffer.ReadFrom: fix bug.
authorRob Pike <r@golang.org>
Wed, 16 Jun 2010 00:40:47 +0000 (17:40 -0700)
committerRob Pike <r@golang.org>
Wed, 16 Jun 2010 00:40:47 +0000 (17:40 -0700)
Fixes #852.

R=rsc
CC=golang-dev
https://golang.org/cl/1680042

src/pkg/bytes/buffer.go

index 32571d8d8e3d5e0d81fbf960e85bc2bb3c4ca4d0..01e6aef674f664e0039d3cbfe3f7a6b982a4cfe8 100644 (file)
@@ -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