Skip to content

Commit

Permalink
fix(parser): Prevent rollover of count
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jun 9, 2022
1 parent cb86785 commit acfb130
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
let existing_value = *matcher
.get_one::<crate::builder::CountType>(arg.get_id())
.unwrap_or(&0);
let next_value = existing_value + 1;
let next_value = existing_value.saturating_add(1);
vec![OsString::from(next_value.to_string())]
}
1 => raw_vals,
Expand Down

0 comments on commit acfb130

Please sign in to comment.