Skip to content

Commit

Permalink
#521: add guard against setting sensitivity to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
karl committed Sep 3, 2023
1 parent 81211e9 commit eb74b75
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ bool validate_config(struct config_params *p, struct error_s *error) {
}

// setting sens
if (p->sens < 1) {
write_errorf(error, "Sensitivity needs to be at least 1%%\n");
return false;
}
p->sens = p->sens / 100;

return validate_colors(p, error);
Expand Down

0 comments on commit eb74b75

Please sign in to comment.