diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-07-09 22:25:22 +0300 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-07-20 18:52:17 +0300 |
| commit | 3c40f0682f3da2d5bde8a0f4626e979735434cc2 (patch) | |
| tree | 6dded9a5a5d89d9521acad3b027c73594e0e9e96 /monsterwm.c | |
| parent | eaedf7026248b353409a1da6bed201fc0e8ff3bc (diff) | |
rework client_to_desktop function - check bounds
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/monsterwm.c b/monsterwm.c index 8fbf554..ba56bf1 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -240,7 +240,7 @@ void cleanup(void) { * add the current client as the last on the new desktop * and then remove it from the current desktop */ void client_to_desktop(const Arg *arg) { - if (arg->i == currdeskidx || !desktops[currdeskidx].curr) return; + if (arg->i == currdeskidx || arg->i < 0 || arg->i >= DESKTOPS || !desktops[currdeskidx].curr) return; Desktop *d = &desktops[currdeskidx], *n = &desktops[arg->i]; Client *p = prevclient(d->curr, d), *l = prevclient(n->head, n); |
