From e6f65122a9e6c6ee3f4c4a5bf359283474bf99a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 15 Jan 2022 09:59:34 +0100 Subject: [PATCH] spell: fix comparison of URL prefix with UTF-8 chars (issue #1739) There is no problem in practice because the possible URL prefixes are hardcoded in the spell plugin and don't contain any UTF-8 char on more than one byte. --- src/plugins/spell/spell.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/spell/spell.c b/src/plugins/spell/spell.c index 8244d003e..b664aa8ed 100644 --- a/src/plugins/spell/spell.c +++ b/src/plugins/spell/spell.c @@ -379,8 +379,10 @@ spell_string_is_url (const char *word) for (i = 0; spell_url_prefix[i]; i++) { if (weechat_strncasecmp (word, spell_url_prefix[i], - strlen (spell_url_prefix[i])) == 0) + weechat_utf8_strlen (spell_url_prefix[i])) == 0) + { return 1; + } } /* word is not an URL */