Skip to content

Commit

Permalink
Merge pull request #90 from susuper/master
Browse files Browse the repository at this point in the history
Fixed incorrect unmarshalling of numbers in scientific format in several cases
  • Loading branch information
francoispqt authored Nov 16, 2018
2 parents 3ebfcfb + 60a9239 commit ef10bf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions decode_number.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func init() {

for i := 0; i < 256; i++ {
switch i {
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.':
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'e', 'E', '+', '-':
skipNumberEndCursorIncrement[i] = 1
}
}
Expand All @@ -74,7 +74,7 @@ func (dec *Decoder) skipNumber() (int, error) {
end += skipNumberEndCursorIncrement[dec.data[j]]

switch dec.data[j] {
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', ' ', '\n', '\t', '\r':
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'e', 'E', '+', '-', ' ', '\n', '\t', '\r':
continue
case ',', '}', ']':
return end, nil
Expand Down

0 comments on commit ef10bf3

Please sign in to comment.