Skip to content

Commit

Permalink
Fix: substracting with overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Dec 7, 2023
1 parent 6c9d73f commit f2011ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/history/file_backed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn decode_entry(s: &str) -> String {

impl History for FileBackedHistory {
fn generate_id(&mut self) -> HistoryItemId {
HistoryItemId((self.entries.len() - 1) as i64)
HistoryItemId((self.entries.len() + 1) as i64)
}

/// only saves a value if it's different than the last value
Expand Down

0 comments on commit f2011ac

Please sign in to comment.