From: Reginald Kennedy Date: Sun, 22 Jul 2012 10:08:39 +0000 (+0800) Subject: Fix user bar_font not being applied to dmenu. X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=13f103ac8c4b74ea05658a6a71d03d98b22a7253;p=spectrwm.git Fix user bar_font not being applied to dmenu. --- diff --git a/spectrwm.c b/spectrwm.c index 14716c7..8e94b16 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1848,7 +1848,7 @@ bar_refresh(void) void bar_setup(struct swm_region *r) { - char *font, *fontpos; + char *font, *fontpos, *dup, *search; int count; xcb_screen_t *screen = get_screen(r->s->idx); uint32_t wa[3]; @@ -1861,7 +1861,10 @@ bar_setup(struct swm_region *r) err(1, "bar_setup: calloc: failed to allocate memory."); if (bar_font == NULL) { - while ((font = strsep(&bar_fonts, ",")) != NULL) { + if ((dup = strdup(bar_fonts)) == NULL) + errx(1, "insufficient memory."); + search = dup; + while ((font = strsep(&search, ",")) != NULL) { if (*font == '\0') continue; @@ -1889,6 +1892,7 @@ bar_setup(struct swm_region *r) break; } } + free(dup); } if (bar_font == NULL)