Skip to content

Commit

Permalink
Fixes subtract with overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Oct 29, 2024
1 parent 02b74a8 commit 1e06a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn pager(pager: &crate::Pager, config: &crate::pager::Config) -> String {
} else if pager.page >= last_page - config.ellipsis {
(last_page - (config.ellipsis + 1), last_page)
} else {
let half = (config.ellipsis - 1) / 2;
let half = config.ellipsis.saturating_sub(1) / 2;
(pager.page - half, pager.page + half)
};

Expand Down

0 comments on commit 1e06a2f

Please sign in to comment.