Skip to content

Commit

Permalink
error fix for small files.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Jul 3, 2024
1 parent 9b29909 commit b752a4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/magicnumber/magicnumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func Program(r io.Reader) (Signature, error) {
func Text(r io.Reader) (Signature, error) {
buf := make([]byte, 512)
_, err := io.ReadFull(r, buf)
if err != nil {
if err != nil && !errors.Is(err, io.ErrUnexpectedEOF) && !errors.Is(err, io.EOF) {
return Unknown, fmt.Errorf("magic number text: %w", err)
}
txts := Texts()
Expand Down

0 comments on commit b752a4d

Please sign in to comment.