Skip to content

Commit

Permalink
Convert to Int before indexing with Char in Array
Browse files Browse the repository at this point in the history
Regression fix from JuliaLang/julia#8816
Fixes #84
  • Loading branch information
ivarne committed Oct 28, 2014
1 parent 888e6dd commit 59c6fd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/JSON.jl
Expand Up @@ -65,10 +65,10 @@ end

function print_escaped(io::IO, s::String)
for c in s
c <= '\x7f' ? (unescaped[c+1] ? Base.print(io, c) :
c <= '\x7f' ? (unescaped[int(c)+1] ? Base.print(io, c) :
c == '\\' ? Base.print(io, "\\\\") :
c == '"' ? Base.print(io, "\\\"") :
8 <= c <= 10 ? Base.print(io, '\\', "btn"[c-7]) :
8 <= c <= 10 ? Base.print(io, '\\', "btn"[int(c)-7]) :
c == '\f' ? Base.print(io, "\\f") :
c == '\r' ? Base.print(io, "\\r") :
Base.print(io, "\\u", hex(c, 4))) :
Expand Down

0 comments on commit 59c6fd6

Please sign in to comment.