]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Boundary checking for current_row and current_col when shrinking table
authorMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 26 Feb 2009 21:23:41 +0000 (22:23 +0100)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 26 Feb 2009 21:23:41 +0000 (22:23 +0100)
src/table.c

index 76e99bd8c2855730f2f96c0e5917a548daf2e7f5..0c4a1be100ee43e1119bf57c81fb45a672612f2d 100644 (file)
@@ -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;
 }