From e49aad647661461777bb80747f09716f2fab2feb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 8 Nov 2017 18:15:09 +0000 Subject: [PATCH] Use Bytes instead of String for mutable byte array. --- goaljobs.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 1.8.3.1