sharesec: Use ARRAY_DEL_ELEMENT() in sort_acl()
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2020 10:39:08 +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/sharesec.c

index 454c5bfe36b029d678006d21f1a995b7a6cb358c..419a6411334210a4251dfedb7fa57c8f6fc706cd 100644 (file)
@@ -145,10 +145,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++;