Skip to content

Commit

Permalink
Fixed incorrect unmarshalling of numbers in scientific format
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey Bondarenko committed Nov 15, 2018
1 parent 3ebfcfb commit 60a9239
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 60a9239

Please sign in to comment.