Skip to content

Commit

Permalink
correct error : when a comment is just after the size value
Browse files Browse the repository at this point in the history
  • Loading branch information
rfautier committed Jul 29, 2019
1 parent 4af9092 commit e67ad02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func (env *Env) readSize(reader *bufio.Reader) error {
len(strings.Fields(firstLine)) > 1 {
return errors.New("error missing size value")
}
firstLine = strings.Replace(firstLine, " ", "", -1)
size, err := strconv.Atoi(firstLine)
if err != nil || size < 3 || size > 31 {
return errors.New("error invalid size value")
Expand Down

0 comments on commit e67ad02

Please sign in to comment.