diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-10-20 21:47:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-10-20 21:47:01 +0100 |
commit | bd2f3f1c94449e4db55ddcfdd3c492d3edd60c19 (patch) | |
tree | 50d5b92468bdabe8d4c0d3b918f5bcb79010092e | |
parent | 005c9fece0912113bf5a8577b08da7ea7946cfab (diff) | |
download | rspamd-bd2f3f1c94449e4db55ddcfdd3c492d3edd60c19.tar.gz rspamd-bd2f3f1c94449e4db55ddcfdd3c492d3edd60c19.zip |
[Minor] Fix url_cmp operation
-rw-r--r-- | src/libserver/url.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c index 62f21e367..7892149af 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -4281,7 +4281,7 @@ rspamd_url_cmp (const struct rspamd_url *u1, const struct rspamd_url *u2) int r; if (u1->protocol != u2->protocol) { - return u1->protocol < u2->protocol; + return u1->protocol - u2->protocol; } if (u1->protocol & PROTOCOL_MAILTO) { @@ -4301,7 +4301,7 @@ rspamd_url_cmp (const struct rspamd_url *u1, const struct rspamd_url *u2) } } else { - r = u1->hostlen < u2->hostlen; + r = u1->hostlen - u2->hostlen; } } } @@ -4311,7 +4311,7 @@ rspamd_url_cmp (const struct rspamd_url *u1, const struct rspamd_url *u2) r = memcmp (u1->string, u2->string, min_len); if (r == 0) { - r = u1->urllen < u2->urllen; + r = u1->urllen - u2->urllen; } } else { |