Skip to content

Commit

Permalink
Change the end of very long window titles to ...
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Nov 8, 2024
1 parent 89d0254 commit d5ce1ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gui-daemon/xside.c
Original file line number Diff line number Diff line change
Expand Up @@ -2912,6 +2912,13 @@ static void handle_wmname(Ghandles * g, struct windowdata *vm_window)
read_struct(g->vchan, untrusted_msg);
/* sanitize start */
untrusted_msg.data[sizeof(untrusted_msg.data) - 1] = 0;
/* change the end of very long window titles to ... */
if (strlen(untrusted_msg.data) == (sizeof(untrusted_msg.data) - 1)) {
untrusted_msg.data[sizeof(untrusted_msg.data) - 2] = '.';
untrusted_msg.data[sizeof(untrusted_msg.data) - 3] = '.';
untrusted_msg.data[sizeof(untrusted_msg.data) - 4] = '.';
untrusted_msg.data[sizeof(untrusted_msg.data) - 5] = ' ';
}
sanitize_string_from_vm((unsigned char *) (untrusted_msg.data),
g->allow_utf8_titles);
if (g->prefix_titles)
Expand Down

0 comments on commit d5ce1ad

Please sign in to comment.