From bd2f3f1c94449e4db55ddcfdd3c492d3edd60c19 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 20 Oct 2022 21:47:01 +0100 Subject: [PATCH] [Minor] Fix url_cmp operation --- src/libserver/url.c | 6 +++--- 1 file 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 { -- 2.39.5