Re: [dwm] sel without clients?

From: Sander van Dijk <a.h.vandijk_AT_gmail.com>
Date: Thu, 10 Aug 2006 22:05:58 +0200

On 8/10/06, Ross Mohn <rpmohn_AT_waxandwane.org> wrote:
> At the beginning of the zoom() function, you return if sel is NULL. But
> then later on you check to see if clients is NULL:
>
> if(clients)
> clients->prev = sel;
>
> How would it be possible for clients to be NULL if sel has a value?

I noticed that too. And yes, when sel != NULL, clients shouldn't be
either. That does not mean I believe the check shouldn't be there
though. It's not a bad thing to explicitly check a (global) pointer
before dereferencing it (since dereferencing a NULL pointer ==
kaboom), even when you know that logically (considering the program
structure) the pointer ought not to be NULL at that point. Program
logic can change over time... (though I have to admit that it is
highly unlikely that it will in this case).

Gr. Sander.
Received on Thu Aug 10 2006 - 22:06:00 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:30:04 UTC