diff options
author | Caleb Malchik <cmalchik@gmail.com> | 2017-05-07 18:08:37 -0700 |
---|---|---|
committer | Quentin Rameau <quinq@fifth.space> | 2017-05-08 08:58:45 +0200 |
commit | 6dc3978edf56ef6760ed818e29eb920138b09802 (patch) | |
tree | 216f174d3e74b351bc9ffecff9f20d94ba5b7de5 | |
parent | 05f583c519a3dc438994a9800ab31a7fa0da72ee (diff) |
Fix movetab and focusurgent when there's no client
Accessing those would crash with a floating point exception.
-rw-r--r-- | tabbed.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -502,6 +502,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); @@ -785,11 +788,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]; |