aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/aux_file.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-01-09 17:14:05 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-01-09 17:14:05 +0100
commit34c19354c9997621a40ad053a2a12edcd8c5b5e4 (patch)
tree189b7c5e5bebe5112e5d1f7dadece4c160decf38 /lib/aux_file.ml
parent37817bb5ac6bb9fa9a4d67a5604a35424f7b343d (diff)
Avoid using the deprecated Scanf.fscanf function.
Diffstat (limited to 'lib/aux_file.ml')
-rw-r--r--lib/aux_file.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/aux_file.ml b/lib/aux_file.ml
index 0f0f09aa2..17f55330d 100644
--- a/lib/aux_file.ml
+++ b/lib/aux_file.ml
@@ -76,14 +76,15 @@ let load_aux_file_for vfile =
let add loc k v = h := set !h loc k v in
let aux_fname = aux_file_name_for vfile in
try
- let ic = open_in aux_fname in
- let ver, hash, fname = Scanf.fscanf ic "COQAUX%d %s %s\n" ret3 in
+ let ib = Scanf.Scanning.from_channel (open_in aux_fname) in
+ let ver, hash, fname =
+ Scanf.bscanf ib "COQAUX%d %s %s\n" ret3 in
if ver <> version then raise (Failure "aux file version mismatch");
if fname <> vfile then
raise (Failure "aux file name mismatch");
let only_dummyloc = Digest.to_hex (Digest.file vfile) <> hash in
while true do
- let i, j, k, v = Scanf.fscanf ic "%d %d %s %S\n" ret4 in
+ let i, j, k, v = Scanf.bscanf ib "%d %d %s %S\n" ret4 in
if not only_dummyloc || (i = 0 && j = 0) then add (i,j) k v;
done;
raise End_of_file