From ad582602435e1ec2734a827a5e66c53e63dd5bdd Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 10 Jul 2008 09:56:23 +0200 Subject: [PATCH] tasklist: use len and set it to 0 if no text Signed-off-by: Julien Danjou --- widgets/tasklist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 5cae8535..8a387027 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -152,7 +152,10 @@ tasklist_draw(draw_context_t *ctx, int screen, if(lua_isstring(globalconf.L, -1)) text = lua_tolstring(globalconf.L, -1, &len); else + { text = NULL; + len = 0; + } lua_pop(globalconf.L, 1); @@ -176,7 +179,7 @@ tasklist_draw(draw_context_t *ctx, int screen, /* Actually look for the proper background color, since * otherwise the background statusbar color is used instead */ markup_parser_data_init(&pdata); - markup_parse(&pdata, text, a_strlen(text)); + markup_parse(&pdata, text, len); markup_parser_data_wipe(&pdata); if((image = draw_image_new(c->icon_path)))