From 408f9174a8fd52128fb38195faacbe1c79aace19 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Mon, 15 May 2006 22:20:45 +0300 Subject: [PATCH] Use int_bounds in move_current_tab. Requested by Miciah Dashiel Butler Masters. --- src/terminal/tab.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/terminal/tab.c b/src/terminal/tab.c index 709bd5dbd..291c8603c 100644 --- a/src/terminal/tab.c +++ b/src/terminal/tab.c @@ -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);