fix "3" too short for date, force error closes #56

This commit is contained in:
Aaron Raddon
2018-04-09 18:54:05 -07:00
parent 647d17def2
commit b8014f0dba
2 changed files with 14 additions and 10 deletions

View File

@@ -1295,6 +1295,8 @@ iterRunes:
} else if len(datestr) == len("2014") {
p.format = []byte("2006")
return p, nil
} else if len(datestr) < 4 {
return nil, fmt.Errorf("unrecognized format, to short %v", datestr)
}
if t.IsZero() {
if secs, err := strconv.ParseInt(datestr, 10, 64); err == nil {