Skip to content
This repository was archived by the owner on Oct 24, 2020. It is now read-only.

Commit 76f607a

Browse files
author
Christopher Zimmermann
committed
fix automatic length calculation when offset is provided
this bug was exposed by the added tests.
1 parent fce0d7b commit 76f607a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bigstring_unix.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let get_bounds name ?(off=0) ?len t =
99
let buffer_len = Bigarray.Array1.dim t in
1010
let len = match len with
1111
| Some len -> len
12-
| None -> buffer_len
12+
| None -> buffer_len - off
1313
in
1414
if len < 0 || off < 0 || buffer_len - off < len
1515
then invalid_arg ("Bigstring_unix." ^ name)

0 commit comments

Comments
 (0)