From: Volker Lendecke Date: Fri, 5 Nov 2021 10:48:25 +0000 (+0100) Subject: lib: Use a direct struct initialization X-Git-Tag: ldb-2.5.0~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b063aa1cf13ece9673edbf225281993cfa39085d;p=thirdparty%2Fsamba.git lib: Use a direct struct initialization Don't init with 0 just to overwrite again. Probably the compiler will figure that out anyway, but to me this looks cleaner. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/filename_util.c b/source3/lib/filename_util.c index f97c4310162..f2ef0fbb074 100644 --- a/source3/lib/filename_util.c +++ b/source3/lib/filename_util.c @@ -57,13 +57,14 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx, NTTIME twrp, uint32_t flags) { - struct smb_filename smb_fname_loc = { 0, }; - /* Setup the base_name/stream_name. */ - smb_fname_loc.base_name = discard_const_p(char, base_name); - smb_fname_loc.stream_name = discard_const_p(char, stream_name); - smb_fname_loc.flags = flags; - smb_fname_loc.twrp = twrp; + + struct smb_filename smb_fname_loc = { + .base_name = discard_const_p(char, base_name), + .stream_name = discard_const_p(char, stream_name), + .flags = flags, + .twrp = twrp, + }; /* Copy the psbuf if one was given. */ if (psbuf)