aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-21 10:56:14 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-10-21 10:56:14 +0100
commita7e0eda40297ccf47ae7d39fe4594d4048c83da9 (patch)
treecd2e1d309df3273334edbc86714f9796bc7fc521
parent2330df2d216719a3a0cadda55b4ff1ccf7dafe5a (diff)
downloadrspamd-a7e0eda40297ccf47ae7d39fe4594d4048c83da9.tar.gz
rspamd-a7e0eda40297ccf47ae7d39fe4594d4048c83da9.zip
[Fix] Do not strip last character in the last word
MFH: rspamd-1.6
-rw-r--r--src/libstat/tokenizers/tokenizers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstat/tokenizers/tokenizers.c b/src/libstat/tokenizers/tokenizers.c
index c4f814fce..49496a9d8 100644
--- a/src/libstat/tokenizers/tokenizers.c
+++ b/src/libstat/tokenizers/tokenizers.c
@@ -198,9 +198,9 @@ rspamd_tokenizer_get_word (rspamd_stat_token_t * buf,
p = s;
token->begin = s;
- for (i = 0; i < remain; ) {
+ for (i = 0; i <= remain; ) {
p = &s[i];
- U8_NEXT (s, i, remain, uc);
+ U8_NEXT (s, i, remain, uc); /* This also advances i */
if (uc < 0) {
if (i < remain) {