diff options
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/monsterwm.c b/monsterwm.c index 0c55e0d..31d41f3 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -575,9 +575,9 @@ void monocle(int hh, int cy) { /* move the current client, to current->next * and current->next to current client's position */ void move_down(void) { + if (!curr || !head->next) return; /* p is previous, c is current, n is next, if current is head n is last */ Client *p = prevclient(curr), *n = (curr->next) ? curr->next:head; - if (!p) return; /* * if c is head, swapping with n should update head to n * [c]->[n]->.. ==> [n]->[c]->.. @@ -612,9 +612,9 @@ void move_down(void) { /* move the current client, to the previous from current and * the previous from current to current client's position */ void move_up(void) { + if (!curr || !head->next) return; /* p is previous from current or last if current is head */ Client *pp = NULL, *p = prevclient(curr); - if (!p) return; /* pp is previous from p, or null if current is head and thus p is last */ if (p->next) for (pp = head; pp && pp->next != p; pp = pp->next); /* |
