diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-11-01 19:25:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-11-01 19:25:44 +0000 |
| commit | dac1ba18c8e97e2a726a83e1cddc1c8f2a40468d (patch) | |
| tree | e7ada71dbaef04ab2c63a3623f4367b0a3199f14 /render.c | |
| parent | wayland: wayl_destroy(): destroy any remaining terminals (diff) | |
render: limit length of title in call to xdg_toplevel_set_title()
Trying to pass a too long title (not sure what "too long" is
though...) will trigger a call to abort() inside the wayland-client
library.
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -950,9 +950,21 @@ render_resize(struct terminal *term, int width, int height) } void -render_set_title(struct terminal *term, const char *title) +render_set_title(struct terminal *term, const char *_title) { + /* TODO: figure out what the limit actually is */ + static const size_t max_len = 100; + + const char *title = _title; + char *copy = NULL; + + if (strlen(title) > max_len) { + copy = strndup(_title, max_len); + title = copy; + } + xdg_toplevel_set_title(term->window->xdg_toplevel, title); + free(copy); } void |
