Skip to content

Commit efd7163

Browse files
committed
Merge pull request #19 from djs55/fix-shift
Fix
2 parents a37b284 + 57e0f7e commit efd7163

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.0.1 (2013-12-09):
2+
* Fix Cstruct.shift function
3+
14
1.0.0 (2013-12-05):
25
* Remove IPv4/IPv6 types (now moved to `ocaml-ipaddr`).
36
* Improved ocamldoc for the interface.

lib/cstruct.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ let sub t off len =
7373
raise (Invalid_argument "Cstruct.sub");
7474
{ t with off; len }
7575

76-
let shift t off =
77-
let off = t.off + off in
78-
let len = t.len - off in
76+
let shift t amount =
77+
let off = t.off + amount in
78+
let len = t.len - amount in
7979
if not (check_bounds t (off+len)) then
8080
raise (Invalid_argument "Cstruct.shift");
8181
{ t with off; len }

0 commit comments

Comments
 (0)