Skip to content

Commit 4c2f6c6

Browse files
Read the full file without line translation
It seems like the length reported by the channel and the one that `really_read` expects do not match when some line ending translation is happening. Thus try to avoid the translation.
1 parent c264027 commit 4c2f6c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_write.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let to_file_tests =
2121
let output_file = Filename.temp_file "test_yojson_to_file" ".json" in
2222
Yojson.Safe.to_file ?suf output_file Fixtures.json_value;
2323
let file_content =
24-
let ic = open_in output_file in
24+
let ic = open_in_bin output_file in
2525
let length = in_channel_length ic in
2626
let s = really_input_string ic length in
2727
close_in ic;

0 commit comments

Comments
 (0)