Skip to content

Commit 1354b6e

Browse files
authored
Fix sendevent so killclient only kills the focused window (#52)
Fixes #51. Apparently I've been indexing beyond the contents of protocols this whole time by not decrementing n before using it as an offset. When bisecting, 7b9e31a was the first bad commit, but killclient itself is fine, it just used my faulty sendevent implementation.
1 parent f119600 commit 1354b6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ pub fn sendevent(
524524
if xlib::XGetWMProtocols(state.dpy, w, &mut protocols, &mut n) != 0
525525
{
526526
while exists == 0 && n > 0 {
527-
exists = (*protocols.offset(n as isize) == proto) as c_int;
528527
n -= 1;
528+
exists = (*protocols.offset(n as isize) == proto) as c_int;
529529
}
530530
XFree(protocols.cast());
531531
}

0 commit comments

Comments
 (0)