From acfb130b0d1397065dc6d4e3b4b1d07547d7c3ca Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 9 Jun 2022 11:05:06 -0500 Subject: [PATCH] fix(parser): Prevent rollover of count --- src/parser/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/parser.rs b/src/parser/parser.rs index b1f365088ad..ed74e94da54 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -1268,7 +1268,7 @@ impl<'help, 'cmd> Parser<'help, 'cmd> { let existing_value = *matcher .get_one::(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,