aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-08-20 05:14:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-08-20 05:14:53 +0000
commit7dd204fd319222c1e500b2c117b4ed62f9e642af (patch)
treee0c997930c5db93b140bfcb32befc065f17632aa
parentchangelog: resize-keep-grid (diff)
osc: notify: fix bad check for invalid UTF-8
mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1.
-rw-r--r--osc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/osc.c b/osc.c
index 3c5f7616..aeb7896c 100644
--- a/osc.c
+++ b/osc.c
@@ -547,12 +547,12 @@ osc_notify(struct terminal *term, char *string)
if (title == NULL)
return;
- if (mbsntoc32(NULL, title, strlen(title), 0) == (char32_t)-1) {
+ if (mbsntoc32(NULL, title, strlen(title), 0) == (size_t)-1) {
LOG_WARN("%s: notification title is not valid UTF-8, ignoring", title);
return;
}
- if (msg != NULL && mbsntoc32(NULL, msg, strlen(msg), 0) == (char32_t)-1) {
+ if (msg != NULL && mbsntoc32(NULL, msg, strlen(msg), 0) == (size_t)-1) {
LOG_WARN("%s: notification message is not valid UTF-8, ignoring", msg);
return;
}