aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-08-20 05:15:22 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-08-20 05:15:22 +0000
commit8f9f3dbd9d8cbcc816584c548dff03add3f022e1 (patch)
tree56b987a9e61e4d21f4380ef1009110af849a1156
parentosc: notify: fix bad check for invalid UTF-8 (diff)
term_set_window_title(): fix bad check for invalid UTF-8
mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1.
-rw-r--r--terminal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/terminal.c b/terminal.c
index dee0b038..ecf21040 100644
--- a/terminal.c
+++ b/terminal.c
@@ -3528,7 +3528,7 @@ term_set_window_title(struct terminal *term, const char *title)
if (term->window_title != NULL && streq(term->window_title, title))
return;
- if (mbsntoc32(NULL, title, strlen(title), 0) == (char32_t)-1) {
+ if (mbsntoc32(NULL, title, strlen(title), 0) == (size_t)-1) {
/* It's an xdg_toplevel::set_title() protocol violation to set
a title with an invalid UTF-8 sequence */
LOG_WARN("%s: title is not valid UTF-8, ignoring", title);