mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -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)
|
while (new_pos < 0 || new_pos >= tabs)
|
||||||
new_pos += new_pos < 0 ? tabs : -tabs;
|
new_pos += new_pos < 0 ? tabs : -tabs;
|
||||||
} else {
|
} else {
|
||||||
if (new_pos < 0)
|
int_bounds(&new_pos, 0, tabs - 1);
|
||||||
new_pos = 0;
|
|
||||||
else if (new_pos >= tabs)
|
|
||||||
new_pos = tabs - 1;
|
|
||||||
}
|
}
|
||||||
assert(0 <= new_pos && new_pos < tabs);
|
assert(0 <= new_pos && new_pos < tabs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user