Use Cstruct.length and require cstruct >= 6.0.0

pull/56/head
Reynir Björnsson 2 years ago
parent fc734dc2cd
commit f9fcd2c733
  1. 1
      builder-web.opam
  2. 2
      db/representation.ml

@ -17,6 +17,7 @@ build: [
depends: [
"builder"
"dream" {>= "1.0.0~alpha2"}
"cstruct" {>= "6.0.0"}
"bos"
"hex"
"caqti"

@ -2,7 +2,7 @@ module Asn = struct
let decode_strict codec cs =
match Asn.decode codec cs with
| Ok (a, cs) ->
if Cstruct.len cs = 0
if Cstruct.length cs = 0
then Ok a
else Error "trailing bytes"
| Error (`Parse msg) -> Error ("parse error: " ^ msg)

Loading…
Cancel
Save