git.annexia.org
/
goaljobs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e9b165e
)
Use Bytes instead of String for mutable byte array.
master
author
Richard W.M. Jones
<rjones@redhat.com>
Wed, 8 Nov 2017 18:15:09 +0000
(18:15 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Wed, 8 Nov 2017 18:15:09 +0000
(18:15 +0000)
goaljobs.ml
patch
|
blob
|
history
diff --git
a/goaljobs.ml
b/goaljobs.ml
index
208882c
..
26d078d
100644
(file)
--- 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
(* 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;
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;
let data = Digest.to_hex (Digest.string data) in
let dir = Filename.temp_dir_name // sprintf "goaljobstmp%s" data in
mkdir dir 0o700;