Skip to content

Commit d6d6852

Browse files
committed
Fix arg parsing with in-line strings
1 parent 4de57bb commit d6d6852

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fxt/read.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)