Skip to content

Commit

Permalink
fix: best_atom_from_slice not returning any atoms at all
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Aug 17, 2023
1 parent 7d548a7 commit f334f26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yara-x/src/compiler/atoms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl Atom {
/// The returned atom will have the `desired_size` if possible, but it can be
/// shorter if the slice is shorter.
pub(crate) fn best_atom_from_slice(s: &[u8], desired_size: usize) -> Atom {
let mut best_quality = 0;
let mut best_quality = i32::MIN;
let mut best_atom = None;

for i in 0..=s.len().saturating_sub(desired_size) {
Expand Down

0 comments on commit f334f26

Please sign in to comment.