Skip to content

Commit

Permalink
s2: Fix up AddSkippableBlock more
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Jan 25, 2024
1 parent 6ac58c9 commit afbe154
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions s2/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) {
if err = w.err(err); err != nil {
return err
}
if n != len(data) {
if n != len(b) {
return w.err(io.ErrShortWrite)
}
w.written += int64(n)
Expand All @@ -305,9 +305,7 @@ func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) {
if err := write(header[:]); err != nil {
return err
}
if err := write(data); err != nil {
return err
}
return write(data)
}

// Create output...
Expand Down

0 comments on commit afbe154

Please sign in to comment.