Skip to content

Commit

Permalink
fix(archive): format issue indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non authored Jun 2, 2021
1 parent 8345d11 commit 3305bbb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions matchers/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,21 @@ func MachO(buf []byte) bool {
// There are two frame formats defined by Zstandard: Zstandard frames and Skippable frames.
// See more details from https://tools.ietf.org/id/draft-kucherawy-dispatch-zstd-00.html#rfc.section.2
func Zst(buf []byte) bool {
if compareBytes(buf, zstdMagic, 0) {
return true
} else {
if compareBytes(buf, zstdMagic, 0) {
return true
} else {
// skippable frames
if len(buf) < 8 {
return false
}
if binary.LittleEndian.Uint32(buf[:4]) & ZstdMagicSkippableMask == ZstdMagicSkippableStart {
userDataLength := binary.LittleEndian.Uint32(buf[4:8])
if len(buf) < 8 + int(userDataLength) {
return false
if binary.LittleEndian.Uint32(buf[:4]) & ZstdMagicSkippableMask == ZstdMagicSkippableStart {
userDataLength := binary.LittleEndian.Uint32(buf[4:8])
if len(buf) < 8 + int(userDataLength) {
return false
}
nextFrame := buf[8+userDataLength:]
return Zst(nextFrame)
}
return false
}
nextFrame := buf[8+userDataLength:]
return Zst(nextFrame)
}
return false
}
}

0 comments on commit 3305bbb

Please sign in to comment.