Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
y-yagi committed Sep 22, 2023
1 parent 0ca5d04 commit 0f0b5cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 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
}
nextFrame := buf[8+userDataLength:]
return Zst(nextFrame)
}
return false
}
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
}
nextFrame := buf[8+userDataLength:]
return Zst(nextFrame)
}
return false
}
}
2 changes: 1 addition & 1 deletion matchers/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const (
TYPE_ODT
)

//reference: https://bz.apache.org/ooo/show_bug.cgi?id=111457
// reference: https://bz.apache.org/ooo/show_bug.cgi?id=111457
func Doc(buf []byte) bool {
if len(buf) > 513 {
return buf[0] == 0xD0 && buf[1] == 0xCF &&
Expand Down

0 comments on commit 0f0b5cb

Please sign in to comment.