ports/security/ocaml-cryptgps/files/patch-crypt__des.ml
Alexey Dokuchaev 9f526a5a76 security/ocaml-cryptgps: ease transition to post-4.06 OCaml
- Use appropriate data type (Bytes) for mutable strings
- Provide more elaborate port description while I'm here

Obtained from:	Debian
2021-09-08 08:02:23 +00:00

17 lines
428 B
OCaml

--- crypt_des.ml.orig 2001-03-10 16:43:21 UTC
+++ crypt_des.ml
@@ -54,12 +54,12 @@ let set_parity key =
let l_key = String.length key in
if l_key <> 8 then
failwith "Crypt_des: invalid key length";
- let key' = String.copy key in
+ let key' = Bytes.of_string key in
for i = 0 to 7 do
let k = Char.code key.[i] in
key'.[i] <- Char.chr(odd_parity.(k))
done;
- key'
+ Bytes.to_string key'
;;