From: Michael Stapelberg Date: Thu, 26 Feb 2009 21:23:41 +0000 (+0100) Subject: Bugfix: Boundary checking for current_row and current_col when shrinking table X-Git-Tag: 3.a~146 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=248b2e27b9abbabd56bcfcd4bca59bd0d6462302;p=i3%2Fi3 Bugfix: Boundary checking for current_row and current_col when shrinking table --- diff --git a/src/table.c b/src/table.c index 76e99bd8..0c4a1be1 100644 --- a/src/table.c +++ b/src/table.c @@ -160,4 +160,11 @@ void cleanup_table(Workspace *workspace) { shrink_table_rows(workspace); } else rows++; } + + /* Boundary checking for current_col and current_row */ + if (current_col >= c_ws->cols) + current_col = c_ws->cols-1; + + if (current_row >= c_ws->rows) + current_row = c_ws->rows-1; }