Skip to content

Commit a2b684c

Browse files
committed
Work around sub array bug in Julia 0.5
See JuliaLang/julia#15138. Anyway passing an unsigned integer is not a good idea as it will trigger the compilation of specific methods for no good reason.
1 parent a89ca42 commit a2b684c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/StringEncodings.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function flush(s::StringEncoder)
209209
s.outbytesleft[] = 0
210210
while s.outbytesleft[] < BUFSIZE
211211
iconv!(s.cd, s.inbuf, s.outbuf, s.inbufptr, s.outbufptr, s.inbytesleft, s.outbytesleft)
212-
write(s.ostream, sub(s.outbuf, 1:(BUFSIZE - s.outbytesleft[])))
212+
write(s.ostream, sub(s.outbuf, 1:(BUFSIZE - Int(s.outbytesleft[]))))
213213
end
214214

215215
s
@@ -273,7 +273,7 @@ function fill_buffer!(s::StringDecoder)
273273
return i
274274
end
275275

276-
s.inbytesleft[] += readbytes!(s.istream, sub(s.inbuf, (s.inbytesleft[]+1):BUFSIZE))
276+
s.inbytesleft[] += readbytes!(s.istream, sub(s.inbuf, Int(s.inbytesleft[]+1):BUFSIZE))
277277
iconv!(s.cd, s.inbuf, s.outbuf, s.inbufptr, s.outbufptr, s.inbytesleft, s.outbytesleft)
278278
end
279279

0 commit comments

Comments
 (0)