From 8f9f3dbd9d8cbcc816584c548dff03add3f022e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 20 Aug 2024 07:15:22 +0200 Subject: [PATCH] term_set_window_title(): fix bad check for invalid UTF-8 mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1. --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);