If the requested group number is invalid, bail but don't kill cwm.

This commit is contained in:
okan 2018-01-23 13:48:49 +00:00
parent e99f1d4683
commit 8675b5e158

View File

@ -155,7 +155,7 @@ group_movetogroup(struct client_ctx *cc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "%s: index out of range (%d)", __func__, idx);
return;
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
@ -216,7 +216,7 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "%s: index out of range (%d)", __func__, idx);
return;
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
@ -239,7 +239,7 @@ group_only(struct screen_ctx *sc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "%s: index out of range (%d)", __func__, idx);
return;
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)