]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix url_cmp operation
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 20 Oct 2022 20:47:01 +0000 (21:47 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 20 Oct 2022 20:47:01 +0000 (21:47 +0100)
src/libserver/url.c

index 62f21e367024cee0f7e8bae425786e15decd3bf0..7892149af93c31bef2fd3ef2379d5947968b75c1 100644 (file)
@@ -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 {