Decoder: check for invalid chars in timezone (#695)

Fixes #694
This commit is contained in:
Thomas Pelletier
2021-12-02 09:00:20 -05:00
committed by GitHub
parent c862c344b3
commit 9bf9be681e
3 changed files with 17 additions and 14 deletions
-12
View File
@@ -886,18 +886,6 @@ func (p *parser) parseIntOrFloatOrDateTime(b []byte) (ast.Reference, []byte, err
return p.scanIntOrFloat(b)
}
func digitsToInt(b []byte) int {
x := 0
for _, d := range b {
x *= 10
x += int(d - '0')
}
return x
}
//nolint:gocognit,cyclop
func (p *parser) scanDateTime(b []byte) (ast.Reference, []byte, error) {
// scans for contiguous characters in [0-9T:Z.+-], and up to one space if
// followed by a digit.