Fix buffer WriteZeroN

This commit is contained in:
世界 2023-12-08 14:51:14 +08:00
parent 01c915e1e4
commit 0d701cfff0
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -230,7 +230,7 @@ func (b *Buffer) WriteZeroN(n int) error {
if b.end+n > b.Cap() {
return io.ErrShortBuffer
}
for i := b.end; i <= b.end+n; i++ {
for i := b.end; i < b.end+n; i++ {
b.data[i] = 0
}
b.end += n