passdb: Use struct allocation
authorVolker Lendecke <vl@samba.org>
Mon, 27 Jan 2020 16:00:59 +0000 (17:00 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 30 Jan 2020 12:27:40 +0000 (12:27 +0000)
Give the compiler more info

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/passdb/machine_sid.c

index cdef1d61c976bd3c59a94cd3485238be20946752..fa420d8edfed1cc666cf631ead2d74f5e1d985b5 100644 (file)
@@ -65,11 +65,11 @@ static void generate_random_sid(struct dom_sid *sid)
        int i;
        uchar raw_sid_data[12];
 
-       ZERO_STRUCTP(sid);
+       *sid = (struct dom_sid) {
+               .sid_rev_num = 1,
+               .id_auth[5] = 5,
+       };
 
-       sid->sid_rev_num = 1;
-       sid->id_auth[5] = 5;
-       sid->num_auths = 0;
        sid->sub_auths[sid->num_auths++] = 21;
 
        generate_random_buffer(raw_sid_data, 12);