From 60a92399010ac907d61a45ddc3ae561e3ab08778 Mon Sep 17 00:00:00 2001 From: Aleksey Bondarenko Date: Thu, 15 Nov 2018 06:15:58 +0000 Subject: [PATCH] Fixed incorrect unmarshalling of numbers in scientific format --- decode_number.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/decode_number.go b/decode_number.go index 1b06b22..0042b47 100644 --- a/decode_number.go +++ b/decode_number.go @@ -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 } } @@ -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