Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

spellcheck: Fix check for default language if LANG contains UTF-8

g_strndup() copies bytes, not UTF-8 characters.
  • Loading branch information...
commit 5d88549932587699b8719e27aed0bb6f936c8b5c 1 parent 0d04f9e
@b4n b4n authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  spellcheck/src/speller.c
View
2  spellcheck/src/speller.c
@@ -267,7 +267,7 @@ gchar *sc_speller_get_default_lang(void)
{ /* if we have something like de_DE.UTF-8, strip everything from the period to the end */
gchar *period = strchr(lang, '.');
if (period != NULL)
- result = g_strndup(lang, g_utf8_pointer_to_offset(lang, period));
+ result = g_strndup(lang, period - lang);
}
}
else
Please sign in to comment.
Something went wrong with that request. Please try again.