From 248b2e27b9abbabd56bcfcd4bca59bd0d6462302 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 26 Feb 2009 22:23:41 +0100 Subject: [PATCH] Bugfix: Boundary checking for current_row and current_col when shrinking table --- src/table.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.39.5