mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
osc: notify: fix bad check for invalid UTF-8
mbsntoc32() returns (size_t)-1 on failure, not (char32_t)-1.
This commit is contained in:
parent
be13788a4f
commit
7dd204fd31
1 changed files with 2 additions and 2 deletions
4
osc.c
4
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue