diff options
| author | Maxime Dénès | 2017-03-21 15:26:17 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2017-03-21 15:33:20 +0100 |
| commit | 28d3bb3c8bddc63d038d8d55a34c928675fa9f7b (patch) | |
| tree | 1eb3fd20c42622c9a1ca7f9349068f7301274038 /lib/cUnix.ml | |
| parent | becc6ef43a0f838d1f6388e8c7373c13f26082bc (diff) | |
| parent | d25b1431eb73a04bdfc0f1ad2922819b69bba93a (diff) | |
Merge PR#134: Enable `-safe-string`
Diffstat (limited to 'lib/cUnix.ml')
| -rw-r--r-- | lib/cUnix.ml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/cUnix.ml b/lib/cUnix.ml index cb436511fb..2542b9751b 100644 --- a/lib/cUnix.ml +++ b/lib/cUnix.ml @@ -91,15 +91,15 @@ let rec waitpid_non_intr pid = let run_command ?(hook=(fun _ ->())) c = let result = Buffer.create 127 in let cin,cout,cerr = Unix.open_process_full c (Unix.environment ()) in - let buff = String.make 127 ' ' in - let buffe = String.make 127 ' ' in + let buff = Bytes.make 127 ' ' in + let buffe = Bytes.make 127 ' ' in let n = ref 0 in let ne = ref 0 in while n:= input cin buff 0 127 ; ne := input cerr buffe 0 127 ; !n+ !ne <> 0 do - let r = String.sub buff 0 !n in (hook r; Buffer.add_string result r); - let r = String.sub buffe 0 !ne in (hook r; Buffer.add_string result r); + let r = Bytes.sub buff 0 !n in (hook r; Buffer.add_bytes result r); + let r = Bytes.sub buffe 0 !ne in (hook r; Buffer.add_bytes result r); done; (Unix.close_process_full (cin,cout,cerr), Buffer.contents result) |
