Skip to content

Commit

Permalink
Fix target level limit check
Browse files Browse the repository at this point in the history
  • Loading branch information
HEnquist committed Nov 9, 2024
1 parent aceddd0 commit 1f510c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1832,8 +1832,8 @@ pub fn validate_config(conf: &mut Configuration, filename: Option<&str>) -> Res<
#[cfg(not(target_os = "linux"))]
let target_level_limit = 2 * conf.devices.chunksize;

if conf.devices.target_level() >= target_level_limit {
let msg = format!("target_level can't be larger than {}", target_level_limit);
if conf.devices.target_level() > target_level_limit {
let msg = format!("target_level cannot be larger than {}", target_level_limit);
return Err(ConfigError::new(&msg).into());
}
if let Some(period) = conf.devices.adjust_period {
Expand Down
2 changes: 1 addition & 1 deletion troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
The config file is invalid Yaml. The error from the Yaml parser is printed in the next line.

### Config options
- target_level can't be larger than *1234*,
- target_level cannot be larger than *1234*,

Target level can't be larger than twice the chunksize.

Expand Down

0 comments on commit 1f510c5

Please sign in to comment.