mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Use int_bounds in move_current_tab.
Requested by Miciah Dashiel Butler Masters.
This commit is contained in:
parent
1fdd9002cb
commit
408f9174a8
@ -311,10 +311,7 @@ move_current_tab(struct session *ses, int direction)
|
||||
while (new_pos < 0 || new_pos >= tabs)
|
||||
new_pos += new_pos < 0 ? tabs : -tabs;
|
||||
} else {
|
||||
if (new_pos < 0)
|
||||
new_pos = 0;
|
||||
else if (new_pos >= tabs)
|
||||
new_pos = tabs - 1;
|
||||
int_bounds(&new_pos, 0, tabs - 1);
|
||||
}
|
||||
assert(0 <= new_pos && new_pos < tabs);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user