Skip to content

Commit

Permalink
Add EOF check in determine_bracket_type()
Browse files Browse the repository at this point in the history
Also converts EOF `error()`s into throwing `EOFError()`s
  • Loading branch information
jiahao committed Dec 2, 2013
1 parent e6aef7e commit c325b6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/JSON.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function determine_bracket_type(io::IO)
elseif c == '['
open_bracket = '['
close_bracket = ']'
elseif c == '\0'
throw(EOFError())
end
end
open_bracket, close_bracket
Expand Down Expand Up @@ -119,6 +121,7 @@ function consumeString(io::IO, obj::IOBuffer)
end
write(obj, c)
end
throw(EOFError())
end

function parse(io::IO)
Expand Down

0 comments on commit c325b6b

Please sign in to comment.