aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-18 17:47:33 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-18 17:47:33 +0000
commitd6de1382a4e2c0ff723f1ee65c8e64c81fb0a76c (patch)
tree99cb3fc7fa8ccce69d97f4de0d63ed586a8822ea /src/libutil/str_util.c
parentebd650875251ddb1fd1fa2760d6a1e1d009e7ff9 (diff)
downloadrspamd-d6de1382a4e2c0ff723f1ee65c8e64c81fb0a76c.tar.gz
rspamd-d6de1382a4e2c0ff723f1ee65c8e64c81fb0a76c.zip
[Fix] Fix substring search in case if srchlen == inlen
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index a67a1f378..80f94707a 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -1896,7 +1896,7 @@ rspamd_substring_search (const gchar *in, gsize inlen,
rspamd_substring_cmp_func);
}
else if (inlen == srchlen) {
- return rspamd_lc_cmp (srch, in, srchlen) == 0;
+ return (rspamd_lc_cmp (srch, in, srchlen) == 0 ? 0 : -1);
}
else {
return (-1);