Skip to content

Commit

Permalink
Make magic numbers quietable
Browse files Browse the repository at this point in the history
  • Loading branch information
hawson authored and hillu committed Dec 16, 2021
1 parent df52480 commit 5462046
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ func handleJar(path string, ra io.ReaderAt, sz int64) {
buf := bytes.NewBuffer(nil)
if _, err := io.CopyN(buf, fr, 4); err != nil {
if err == io.EOF {
fmt.Fprintf(logFile, "can't read magic from JAR file member: %s (%s): %v\n", path, file.Name, err)
if !quiet {
fmt.Fprintf(logFile, "can't read magic from JAR file member: %s (%s): %v\n", path, file.Name, err)
}
}
fr.Close()
continue
Expand Down

0 comments on commit 5462046

Please sign in to comment.