diff --git a/reader.go b/reader.go index c8155bb..1f9dbba 100644 --- a/reader.go +++ b/reader.go @@ -117,7 +117,11 @@ func (d *decoder) decodeHeader() error { comment := false for fields := 0; fields < 3; { - b, _ = d.br.ReadByte() + b, err = d.br.ReadByte() + if err != nil { + return errBadHeader + } + if b == '#' { comment = true } else if !comment {