diff --git a/bytes.v7/replace.go b/bytes.v7/replace.go index e0ff138..a62a161 100644 --- a/bytes.v7/replace.go +++ b/bytes.v7/replace.go @@ -17,8 +17,7 @@ func ReplaceAt(b []byte, off, nsrc int, dest []byte) []byte { } if ndelta > 0 { - tailoff := len(b) - ndelta - b = append(b, b[tailoff:]...) + b = append(b, dest[:ndelta]...) copy(b[off+len(dest):], b[off+nsrc:]) copy(b[off:], dest) } else {