Skip to content

Commit

Permalink
Replace deprecated Cstruct.copy with to_string (#123)
Browse files Browse the repository at this point in the history
* Replace deprecated Cstruct.copy with to_string

Co-authored-by: Hannes Mehnert <hannes@mehnert.org>
Co-authored-by: Christiano Haesbaert <haesbaert@haesbaert.org>
  • Loading branch information
3 people committed Apr 4, 2023
1 parent d39be5f commit 7a874ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dhcp_wire.ml
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,10 @@ let options_of_buf buf buf_len =
(get_ip_tuple_list ())
in
let get_string () = if len < 1 then invalid_arg bad_len else
Cstruct.copy body 0 len
Cstruct.to_string ~len body
in
let get_client_id () = if len < 2 then invalid_arg bad_len else
let s = Cstruct.copy body 1 (len - 1) in
let s = Cstruct.to_string ~off:1 ~len:(len - 1) body in
let htype = Cstruct.get_uint8 body 0 in
if htype = 1 && len = 7 then
Hwaddr (Macaddr.of_octets_exn s)
Expand Down

0 comments on commit 7a874ed

Please sign in to comment.