From f29c717f7e0d4e9065f819e0ec7c7517cefdf69d Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 27 Aug 2015 18:42:56 +0000 Subject: Add consistent checks against NULL. --- client.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index cbfc407..0fd7426 100644 --- a/client.c +++ b/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.207 2015/08/27 18:40:09 okan Exp $ + * $OpenBSD: client.c,v 1.208 2015/08/27 18:42:56 okan Exp $ */ #include @@ -204,7 +204,7 @@ client_setactive(struct client_ctx *cc) if (cc->flags & CLIENT_WM_TAKE_FOCUS) client_msg(cc, cwmh[WM_TAKE_FOCUS], Last_Event_Time); - if ((oldcc = client_current())) { + if ((oldcc = client_current()) != NULL) { oldcc->flags &= ~CLIENT_ACTIVE; client_draw_border(oldcc); } @@ -707,9 +707,10 @@ client_cycle_leave(struct screen_ctx *sc) sc->cycling = 0; - if ((cc = client_current())) { + if ((cc = client_current()) != NULL) { client_mtf(cc); - group_toggle_membership_leave(cc); + cc->flags &= ~CLIENT_HIGHLIGHT; + client_draw_border(cc); XUngrabKeyboard(X_Dpy, CurrentTime); } } @@ -914,7 +915,7 @@ client_transient(struct client_ctx *cc) Window trans; if (XGetTransientForHint(X_Dpy, cc->win, &trans)) { - if ((tc = client_find(trans)) && tc->group) { + if ((tc = client_find(trans)) != NULL && tc->group) { group_movetogroup(cc, tc->group->num); if (tc->flags & CLIENT_IGNORE) cc->flags |= CLIENT_IGNORE; -- cgit v1.2.3-2-gb3c3