fix segfault after querying window with no children - lsw - lists window titles of X clients to stdout
 (HTM) git clone git://git.suckless.org/lsw
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit a2e5856f22739a9056fa41789369948450cd7e36
 (DIR) parent 4d6e1b39e14666dd0738301fa0ac1ab246ac1070
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Sat, 25 Jun 2022 10:11:26 +0200
       
       fix segfault after querying window with no children
       
       Reported by Augusto Castelo <alpheratz99@protonmail.com>, thanks!
       
       Diffstat:
         M lsw.c                               |       2 +-
       
       1 file changed, 1 insertion(+), 1 deletion(-)
       ---
 (DIR) diff --git a/lsw.c b/lsw.c
       @@ -36,7 +36,7 @@ lsw(Window win) {
                Window *wins, *w, dw;
                XWindowAttributes wa;
        
       -        if(!XQueryTree(dpy, win, &dw, &dw, &wins, &n))
       +        if(!XQueryTree(dpy, win, &dw, &dw, &wins, &n) || !n)
                        return;
                for(w = &wins[n-1]; w >= &wins[0]; w--)
                        if(XGetWindowAttributes(dpy, *w, &wa)