http://code.google.com/p/bitstring/issues/detail?id=18
let dropbits n (data, off, len) =
let off = off + n in
let len = len - n in
- if len < 0 then invalid_arg "dropbits";
+ if len < 0 || n < 0 then invalid_arg "dropbits";
(data, off, len)
let takebits n (data, off, len) =
- if len < n then invalid_arg "takebits";
+ if len < n || n < 0 then invalid_arg "takebits";
(data, off, n)
(*----------------------------------------------------------------------*)