From: Richard W.M. Jones Date: Wed, 8 Nov 2017 18:15:09 +0000 (+0000) Subject: Use Bytes instead of String for mutable byte array. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=goaljobs.git Use Bytes instead of String for mutable byte array. --- diff --git a/goaljobs.ml b/goaljobs.ml index 208882c..26d078d 100644 --- a/goaljobs.ml +++ b/goaljobs.ml @@ -246,9 +246,10 @@ let url_contains_string url str = (* Create a temporary directory. It is *not* deleted on exit. *) let make_tmpdir () = let chan = open_in "/dev/urandom" in - let data = String.create 16 in - really_input chan data 0 (String.length data); + let data = Bytes.create 16 in + really_input chan data 0 (Bytes.length data); close_in chan; + let data = Bytes.to_string data in let data = Digest.to_hex (Digest.string data) in let dir = Filename.temp_dir_name // sprintf "goaljobstmp%s" data in mkdir dir 0o700;