summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-08-25 11:27:30 +0200
committerAndrew Bartlett <abartlet@samba.org>2017-09-16 08:36:17 +0200
commit3101ac93e20027f8c0b9bfe59af55637ec1d5739 (patch)
tree70059a977cd2f9012c0088dc83752fbc3d310362 /libcli
parentb62bba83ba8544adfc3700e927247ec942735538 (diff)
downloadsamba-3101ac93e20027f8c0b9bfe59af55637ec1d5739.tar.gz
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 <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/auth/netlogon_creds_cli.c7
1 files 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;