Skip to content

Commit 2a7af65

Browse files
authored
Allow non 1-based arrays in readbytes! (#200)
1 parent fa0bd1f commit 2a7af65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stream.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ function Base.readbytes!(stream::TranscodingStream, b::DenseArray{UInt8}, nb=len
431431
resize!(b, min(max(length(b) * 2, 8), nb))
432432
resized = true
433433
end
434-
filled += GC.@preserve b unsafe_read(stream, pointer(b, filled+1), min(length(b), nb)-filled)
434+
filled += GC.@preserve b unsafe_read(stream, pointer(b, filled+firstindex(b)), min(length(b), nb)-filled)
435435
end
436436
if resized
437437
resize!(b, filled)

0 commit comments

Comments
 (0)