]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
srvsvc: Use a struct assignment in enum_file_fn()
authorVolker Lendecke <vl@samba.org>
Tue, 21 Apr 2020 12:21:49 +0000 (14:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 May 2020 20:29:38 +0000 (20:29 +0000)
Looks nicer than 5 complex array references...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14355

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/srvsvc/srv_srvsvc_nt.c

index dc3ee32cd960205f1eadc4f9cf1f2451cea8bc97..c795dd2c6eb344c51446ab5c34f8bc898f075a7b 100644 (file)
@@ -155,12 +155,14 @@ static int enum_file_fn(struct file_id id,
 
        /* now fill in the srvsvc_NetFileInfo3 struct */
 
-       ctr3->array[i].fid              =
-               (((uint32_t)(procid_to_pid(&e->pid))<<16) | e->share_file_id);
-       ctr3->array[i].permissions      = permissions;
-       ctr3->array[i].num_locks                = num_locks;
-       ctr3->array[i].path             = fullpath;
-       ctr3->array[i].user             = username;
+       ctr3->array[i] = (struct srvsvc_NetFileInfo3) {
+               .fid            = (((uint32_t)(procid_to_pid(&e->pid))<<16) |
+                                  e->share_file_id),
+               .permissions    = permissions,
+               .num_locks      = num_locks,
+               .path           = fullpath,
+               .user           = username,
+       };
 
        ctr3->count++;