]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb:mod: repl_md: message sort uses NUMERIC_CMP()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 12 Apr 2024 08:28:04 +0000 (20:28 +1200)
committerJule Anger <janger@samba.org>
Mon, 10 Jun 2024 13:25:17 +0000 (13:25 +0000)
No change at all in the result, just saving lines and branches.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 827b0c39ed0497407bfcfc5683735a165b1b0f0a)

source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 762fe69f6c559794d113f4d5b5f59115d4571cc2..4f2aefe7662ed0bc7712945d6ea5122461802c85 100644 (file)
@@ -1077,10 +1077,7 @@ static int replmd_ldb_message_element_attid_sort(const struct ldb_message_elemen
        if (a2 == NULL) {
                return -1;
        }
-       if (a1->attributeID_id == a2->attributeID_id) {
-               return 0;
-       }
-       return a1->attributeID_id > a2->attributeID_id ? 1 : -1;
+       return NUMERIC_CMP(a1->attributeID_id, a2->attributeID_id);
 }
 
 static void replmd_ldb_message_sort(struct ldb_message *msg,