Skip to content

Commit a5a1baf

Browse files
committed
Fix usage side_diff in fuzzers
1 parent 7355680 commit a5a1baf

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

fuzz/fuzz_targets/fuzz_side.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
#[macro_use]
33
extern crate libfuzzer_sys;
44

5-
use diffutilslib::side_diff;
5+
use diffutilslib::side_diff::{self, Params};
66

77
use std::fs::File;
88
use std::io::Write;
9-
use diffutilslib::params::Params;
109

1110
fuzz_target!(|x: (Vec<u8>, Vec<u8>, /* usize, usize */ bool)| {
1211
let (original, new, /* width, tabsize, */ expand) = x;
@@ -22,7 +21,16 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>, /* usize, usize */ bool)| {
2221
..Default::default()
2322
};
2423
let mut output_buf = vec![];
25-
side_diff::diff(&original, &new, &mut output_buf, &params);
24+
side_diff::diff(
25+
&original,
26+
&new,
27+
&mut output_buf,
28+
&Params {
29+
width: params.width,
30+
tabsize: params.tabsize,
31+
expand_tabs: params.expand_tabs,
32+
},
33+
);
2634
File::create("target/fuzz.file.original")
2735
.unwrap()
2836
.write_all(&original)
@@ -39,4 +47,5 @@ fuzz_target!(|x: (Vec<u8>, Vec<u8>, /* usize, usize */ bool)| {
3947
.unwrap()
4048
.write_all(&output_buf)
4149
.unwrap();
42-
});
50+
});
51+

0 commit comments

Comments
 (0)