summaryrefslogtreecommitdiff
path: root/bytecomp/bytesections.ml
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2014-04-29 11:56:17 +0000
committerDamien Doligez <damien.doligez-inria.fr>2014-04-29 11:56:17 +0000
commit5b8df637d2b722aa397ab53200a733bae238e9fe (patch)
tree522cd6e4b131d3e0a7b4ddeac46bc4e1efdb2fad /bytecomp/bytesections.ml
parent3ce32fba4fe8be1c77096ca1f70dd14233d67b49 (diff)
downloadocaml-5b8df637d2b722aa397ab53200a733bae238e9fe.tar.gz
merge branch "safe-string"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/bytesections.ml')
-rw-r--r--bytecomp/bytesections.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/bytecomp/bytesections.ml b/bytecomp/bytesections.ml
index 5af3bc5237..15afdc0efd 100644
--- a/bytecomp/bytesections.ml
+++ b/bytecomp/bytesections.ml
@@ -46,12 +46,14 @@ let read_toc ic =
let pos_trailer = in_channel_length ic - 16 in
seek_in ic pos_trailer;
let num_sections = input_binary_int ic in
- let header = Misc.input_bytes ic (String.length Config.exec_magic_number) in
+ let header =
+ really_input_string ic (String.length Config.exec_magic_number)
+ in
if header <> Config.exec_magic_number then raise Bad_magic_number;
seek_in ic (pos_trailer - 8 * num_sections);
section_table := [];
for _i = 1 to num_sections do
- let name = Misc.input_bytes ic 4 in
+ let name = really_input_string ic 4 in
let len = input_binary_int ic in
section_table := (name, len) :: !section_table
done
@@ -77,7 +79,7 @@ let seek_section ic name =
(* Return the contents of a section, as a string *)
let read_section_string ic name =
- Misc.input_bytes ic (seek_section ic name)
+ really_input_string ic (seek_section ic name)
(* Return the contents of a section, as marshalled data *)