smbcacls: Use ARRAY_DEL_ELEMENT() in sort_acl()
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2020 10:39:56 +0000 (11:39 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 26 Mar 2020 14:43:31 +0000 (14:43 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/smbcacls.c

index 084df9f9a4a72b087a8f6b124f910e6d6f416217..103acdc1d1868882d68ea49f696ec4cf914e6a65 100644 (file)
@@ -499,10 +499,8 @@ static void sort_acl(struct security_acl *the_acl)
        for (i=1;i<the_acl->num_aces;) {
                if (security_ace_equal(&the_acl->aces[i-1],
                                       &the_acl->aces[i])) {
-                       int j;
-                       for (j=i; j<the_acl->num_aces-1; j++) {
-                               the_acl->aces[j] = the_acl->aces[j+1];
-                       }
+                       ARRAY_DEL_ELEMENT(
+                               the_acl->aces, i, the_acl->num_aces);
                        the_acl->num_aces--;
                } else {
                        i++;