Skip to content

Commit

Permalink
Fixed potential garbage return value in event.c's NextActiveWin(), as…
Browse files Browse the repository at this point in the history
… identified by clang scan-build. Issue #48
  • Loading branch information
morgant committed Sep 2, 2024
1 parent 548842f commit 00fd54c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mlvwm/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ MlvwmWindow *NextActiveWin( MlvwmWindow *t )
int lp;
Window parent, *children;
unsigned nchildren;
MlvwmWindow *NextActive;
MlvwmWindow *NextActive = NULL;

XQueryTree( dpy, Scr.Root, &Scr.Root, &parent, &children, &nchildren );
for( lp=nchildren-1; lp>-1; lp-- ){
for ( lp = nchildren - 1; lp > -1; lp-- ) {
if( XFindContext( dpy, children[lp], MlvwmContext,
(caddr_t *)&NextActive )
!=XCNOENT &&
Expand All @@ -257,7 +257,7 @@ MlvwmWindow *NextActiveWin( MlvwmWindow *t )
NextActive->Desk==Scr.currentdesk)
break;
}
if( lp==-1 )
if ( lp == -1 )
NextActive = NULL;
XFree( children );
return NextActive;
Expand Down

0 comments on commit 00fd54c

Please sign in to comment.