libsmb: Use ARRAY_DEL_ELEMENT() in sort_acl()
authorVolker Lendecke <vl@samba.org>
Wed, 25 Mar 2020 21:36:48 +0000 (22:36 +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/libsmb/libsmb_xattr.c

index 06a1d0c601dd4f828bd7b2e893d595ca466a7860..8dde8c1bc90fa197cde378dcb433d0ebdbed3819 100644 (file)
@@ -154,10 +154,8 @@ 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++;