aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-25 17:34:08 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-25 17:34:08 +0000
commite180ef2ce601b4118dab29ab074712c0a58244e4 (patch)
treeb3da007cff3ce5964f86e868301fc9cb897ffb70 /src/libmime
parent63ef123b048d5f1f2f6a5d172be6dc1a2629e2d7 (diff)
downloadrspamd-e180ef2ce601b4118dab29ab074712c0a58244e4.tar.gz
rspamd-e180ef2ce601b4118dab29ab074712c0a58244e4.zip
[Project] Finish basic tasks in new unicode project
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/lang_detection.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c
index dbe9dbe95..e80a13e29 100644
--- a/src/libmime/lang_detection.c
+++ b/src/libmime/lang_detection.c
@@ -560,8 +560,9 @@ rspamd_language_detector_read_file (struct rspamd_config *cfg,
cur_ucs = ucs_elt->s;
nsym = 0;
+ uc_err = U_ZERO_ERROR;
- while (keylen > 0) {
+ while (cur_utf < end) {
*cur_ucs++ = ucnv_getNextUChar (d->uchar_converter, &cur_utf,
end, &uc_err);
if (!U_SUCCESS (uc_err)) {
@@ -569,12 +570,11 @@ rspamd_language_detector_read_file (struct rspamd_config *cfg,
}
nsym ++;
- keylen --;
}
if (!U_SUCCESS (uc_err)) {
- msg_warn_config ("cannot convert key to unicode: %s",
- u_errorName (uc_err));
+ msg_warn_config ("cannot convert key %*s to unicode: %s",
+ (gint)keylen, key, u_errorName (uc_err));
continue;
}
@@ -1178,7 +1178,7 @@ rspamd_language_detector_detect_type (struct rspamd_task *task,
{
guint nparts = MIN (words->len, nwords);
goffset *selected_words;
- rspamd_stat_token_t *tok, ucs_w;
+ rspamd_stat_token_t *tok;
guint i;
selected_words = g_new0 (goffset, nparts);