aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/stream.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding/json/stream.go')
-rw-r--r--src/encoding/json/stream.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/encoding/json/stream.go b/src/encoding/json/stream.go
index e29127499b..3d30322ce2 100644
--- a/src/encoding/json/stream.go
+++ b/src/encoding/json/stream.go
@@ -102,6 +102,10 @@ Input:
dec.scan.bytes++
switch dec.scan.step(&dec.scan, c) {
case scanEnd:
+ // scanEnd is delayed one byte so we decrement
+ // the scanner bytes count by 1 to ensure that
+ // this value is correct in the next call of Decode.
+ dec.scan.bytes--
break Input
case scanEndObject, scanEndArray:
// scanEnd is delayed one byte.