diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-05 18:28:35 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-05-05 22:29:37 +1000 |
commit | 936226845fc08ee64b6914b233d901ae92994206 (patch) | |
tree | 7a4017641b384f2c33fbcb3a23d3c2bc497a9d17 | |
parent | 5d6d24e71aabc026c99ac736c788fa8103658c42 (diff) |
Add extra check for view title being NULL
-rw-r--r-- | sway/tree/view.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 851348d8..fe944466 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -501,10 +501,10 @@ void view_child_destroy(struct sway_view_child *child) { static size_t parse_title_format(struct sway_view *view, char *buffer) { if (!view->title_format || strcmp(view->title_format, "%title") == 0) { const char *title = view_get_title(view); - if (buffer) { + if (buffer && title) { strcpy(buffer, title); } - return strlen(title); + return title ? strlen(title) : 0; } const char *title = view_get_title(view); const char *class = view_get_class(view); |