From f236a22b6243df9d790885288474cfc94e1a53a0 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 21 Oct 2008 17:45:05 +0200 Subject: [PATCH] widget: bug fix when widget->len = 0 Signed-off-by: Julien Danjou --- widget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget.c b/widget.c index 45ff4caff..166a63810 100644 --- a/widget.c +++ b/widget.c @@ -188,7 +188,7 @@ widget_render(widget_node_array_t *widgets, draw_context_t *ctx, xcb_gcontext_t left += widgets->tab[i].widget->draw(ctx, screen, &widgets->tab[i], left, (left + right), wibox); /* renders right widget from last to first */ - for(int i = widgets->len - 1; i; i--) + for(int i = widgets->len - 1; i >= 0; i--) if(widgets->tab[i].widget->align == AlignRight && widgets->tab[i].widget->isvisible) right += widgets->tab[i].widget->draw(ctx, screen, &widgets->tab[i], right, (left + right), wibox);