s3:mod:posixacl_xattr: use NUMERIC_CMP in posixacl_xattr_entry_compare
[samba.git] / source3 / modules / posixacl_xattr.c
index 365cdc79973f2b70b807aa526badacc96fa5dcb6..5d0516cf7541c0a460f2368a629e02b7e76454fa 100644 (file)
@@ -226,14 +226,14 @@ static int posixacl_xattr_entry_compare(const void *left, const void *right)
        tag_left = SVAL(left, 0);
        tag_right = SVAL(right, 0);
 
-       ret = (tag_left - tag_right);
-       if (!ret) {
+       ret = NUMERIC_CMP(tag_left, tag_right);
+       if (ret == 0) {
                /* ID is the third element in the entry, after two short
                   integers (tag and perm), i.e at offset 4.
                */
                id_left = IVAL(left, 4);
                id_right = IVAL(right, 4);
-               ret = id_left - id_right;
+               ret = NUMERIC_CMP(id_left, id_right);
        }
 
        return ret;