File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ module Args = struct
5050
5151 let parse t cs : (string * value) * Cstruct.t =
5252 let header = Cstruct.LE. get_uint64 cs 0 in
53- let cs = Cstruct. shift cs 8 in
5453 let ty = i64 header land 0xf in
5554 let size = i64 (header >>> 4 ) land 0xfff in
55+ let rest = Cstruct. shift cs (size * 8 ) in
56+ let cs = Cstruct. shift cs 8 in
5657 let name = i64 (header >>> 16 ) land 0xffff in
5758 let name, cs = parse_string t name cs in
5859 let value =
@@ -67,8 +68,7 @@ module Args = struct
6768 | 8 -> `Koid (Cstruct.LE. get_uint64 cs 0 )
6869 | x -> `Unknown x
6970 in
70- let cs = Cstruct. shift cs ((size - 1 ) * 8 ) in
71- (name, value), cs
71+ (name, value), rest
7272
7373 let pp_value f = function
7474 | `Int64 x -> Fmt. pf f " %Ld" x
@@ -289,6 +289,7 @@ let records r =
289289 match record t r with
290290 | None -> seq ()
291291 | Some x -> Cons (x, seq)
292+ | exception End_of_file -> Seq. Nil (* File may be being written at the same time *)
292293 )
293294 in
294295 seq
You can’t perform that action at this time.
0 commit comments