From 0214014fbedb905b5d09e2916e831d47f534d992 Mon Sep 17 00:00:00 2001 From: Gregor Best Date: Tue, 21 Jan 2014 19:18:00 +0100 Subject: Fix crash on client termination Signed-off-by: Gregor Best Signed-off-by: Christoph Lohmann <20h@r-36.net> --- tabbed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tabbed.c b/tabbed.c index 9405644..d30206b 100644 --- a/tabbed.c +++ b/tabbed.c @@ -1094,6 +1094,7 @@ unmanage(int c) { } else if(lastsel > c) { lastsel--; } + lastsel = MIN(lastsel, nclients - 1); if(c == sel) { /* Note that focus() will never set lastsel == sel, -- cgit v1.2.3