mirror of
https://git.freebsd.org/ports.git
synced 2025-05-15 16:51:52 -04:00
- Use appropriate data type (Bytes) for mutable strings - Provide more elaborate port description while I'm here Obtained from: Debian
17 lines
428 B
OCaml
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'
|
|
;;
|
|
|
|
|