]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: Use ARRAY_DEL_ELEMENT() in del_fruit_stream()
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2020 09:41:30 +0000 (10:41 +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/modules/vfs_fruit.c

index 65390a8d17704d69cdab1531b42aa2c3b9031959..1d82b47045cdaf3ebea83401c6d95b2b44829433 100644 (file)
@@ -404,11 +404,7 @@ static bool del_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
        }
 
        TALLOC_FREE(tmp[i].name);
-       if (*num_streams - 1 > i) {
-               memmove(&tmp[i], &tmp[i+1],
-                       (*num_streams - i - 1) * sizeof(struct stream_struct));
-       }
-
+       ARRAY_DEL_ELEMENT(tmp, i, *num_streams);
        *num_streams -= 1;
        return true;
 }