commit 9aeffb1e9572ed75522e9739c064855c7eab2f41
parent 23623e4ffa5aacb896fa4ac7164ad57918a528ba
Author: Christoph Lohmann <20h@r-36.net>
Date: Mon, 8 May 2017 06:05:28 +0200
Fix crash on foscusurgent() or movetab() when there is no client.
Thanks bleb for the suggestion and quinq for the modification!
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tabbed.c b/tabbed.c
@@ -557,6 +557,9 @@ focusurgent(const Arg *arg)
{
int c;
+ if (sel < 0)
+ return;
+
for (c = (sel + 1) % nclients; c != sel; c = (c + 1) % nclients) {
if (clients[c]->urgent) {
focus(c);
@@ -803,11 +806,14 @@ movetab(const Arg *arg)
int c;
Client *new;
+ if (sel) < 0)
+ return;
+
c = (sel + arg->i) % nclients;
if (c < 0)
c += nclients;
- if (sel < 0 || c == sel)
+ if (c == sel)
return;
new = clients[sel];