From 395c0ba6d73ba4e1f551fdd829a204a649c99a9f Mon Sep 17 00:00:00 2001 From: Nikos Ntarmos Date: Mon, 17 Dec 2007 07:35:08 +0100 Subject: [PATCH] mouse button press on the statusbar causes segfault The tags member of screen is no longer an array but a linked list, thus tags[0] (used in config.c) is ok since tags points to the first tag struct, but tags[i], i>0 is wrong. There is one such use in handle_event_buttonpress, causing awesome to segfault when pressing with the mouse on the statusbar. The attached patch fixes this. --- event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/event.c b/event.c index 13db75ca4..93b2b871e 100644 --- a/event.c +++ b/event.c @@ -75,7 +75,7 @@ handle_event_buttonpress(XEvent * e) { for(i = 1, tag = globalconf.screens[screen].tags; tag; tag = tag->next, i++) { - x += textwidth_primitive(e->xany.display, globalconf.screens[screen].font, globalconf.screens[screen].tags[i].name); + x += textwidth_primitive(e->xany.display, globalconf.screens[screen].font, tag->name); if(((globalconf.screens[screen].statusbar.position == BarTop || globalconf.screens[screen].statusbar.position == BarBot) && ev->x < x)