1
0
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:
Kalle Olavi Niemitalo 2006-05-15 22:20:45 +03:00 committed by Kalle Olavi Niemitalo
parent 1fdd9002cb
commit 408f9174a8

View File

@ -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);