From 3101ac93e20027f8c0b9bfe59af55637ec1d5739 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 25 Aug 2017 11:27:30 +0200 Subject: [PATCH] netlogon_creds_cli: Avoid a static const struct Same number of .text bytes, but simpler code. Yes, this is {{0}} instead of {0}, which I always promote. I've just read a comment on stackoverflow (which I've unfortunately just closed the tab for :-() that {{0}} might actually be the correct way to init a struct to zero if the first struct element is again a struct. I'm lost. 25 years of C coding and I have no clue of the language :-( Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- libcli/auth/netlogon_creds_cli.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 6cf8242041a..2b238b701bc 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -572,7 +572,6 @@ NTSTATUS netlogon_creds_cli_get(struct netlogon_creds_cli_context *context, .status = NT_STATUS_INTERNAL_ERROR, .required_flags = context->client.required_flags, }; - static const struct netr_Credential zero_creds; *_creds = NULL; @@ -592,9 +591,9 @@ NTSTATUS netlogon_creds_cli_get(struct netlogon_creds_cli_context *context, * mark it as invalid for step operations. */ fstate.creds->sequence = 0; - fstate.creds->seed = zero_creds; - fstate.creds->client = zero_creds; - fstate.creds->server = zero_creds; + fstate.creds->seed = (struct netr_Credential) {{0}}; + fstate.creds->client = (struct netr_Credential) {{0}}; + fstate.creds->server = (struct netr_Credential) {{0}}; if (context->server.cached_flags == fstate.creds->negotiate_flags) { *_creds = fstate.creds; -- 2.11.4.GIT