From: Ingo Bürk Date: Fri, 4 Sep 2015 23:18:35 +0000 (+0200) Subject: Correctly handle an absent window title to avoid a crash for applications that only... X-Git-Tag: 4.11~32^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F1891%2Fhead;p=i3%2Fi3 Correctly handle an absent window title to avoid a crash for applications that only set it after opening the window. fixes #1890 --- diff --git a/src/window.c b/src/window.c index 278918c7..5ecf51c6 100644 --- a/src/window.c +++ b/src/window.c @@ -359,7 +359,7 @@ i3String *window_parse_title_format(i3Window *win) { for (char *walk = format; *walk != '\0'; walk++) { if (STARTS_WITH(walk, "%title")) { if (escaped_title == NULL) - escaped_title = i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name); + escaped_title = win->name == NULL ? "" : i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name); buffer_len = buffer_len - strlen("%title") + strlen(escaped_title); walk += strlen("%title") - 1;