Skip to content

Commit

Permalink
std/encoding/json: fix the Decode function throws UnexpectedToken err…
Browse files Browse the repository at this point in the history
…or if JSON input have trailing spaces
  • Loading branch information
mertcandav committed Feb 8, 2025
1 parent e5fd70d commit 5f5c626
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions std/encoding/json/decode.jule
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ impl jsonDecoder {
if !self.eof() {
self.value(t) else { error(error) }
}
self.skipSpace()
if len(self.data)-self.i > 0 {
error(DecodeError.UnexpectedEnd)
}
Expand Down

0 comments on commit 5f5c626

Please sign in to comment.