From 98bcdca632c7e508af2ecb3e8d6e005d04523c83 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 31 Dec 2016 12:45:51 +0000 Subject: [PATCH] torture-netlogon: Use "all_zero" where appropriate MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ... Saves a few bytes of footprint Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Tue Jan 3 19:56:17 CET 2017 on sn-devel-144 --- source4/torture/rpc/netlogon.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 1d24f07858c..455fce611ae 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -932,7 +932,6 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context NTSTATUS status; struct netr_LogonSamLogon r; struct netr_Authenticator auth, auth2; - static const struct netr_Authenticator auth_zero; union netr_LogonLevel logon; union netr_Validation validation; uint8_t authoritative; @@ -1032,7 +1031,7 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context torture_assert_int_equal(tctx, *r.out.authoritative, 1, "LogonSamLogon invalid *r.out.authoritative"); torture_assert(tctx, - memcmp(&auth2, &auth_zero, sizeof(auth2)) == 0, + all_zero((uint8_t *)&auth2, sizeof(auth2)), "Return authenticator non zero"); } @@ -1070,7 +1069,7 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context "LogonSamLogon expected INVALID_PARAMETER"); torture_assert(tctx, - memcmp(&auth2, &auth_zero, sizeof(auth2)) == 0, + all_zero((uint8_t *)&auth2, sizeof(auth2)), "Return authenticator non zero"); torture_assert_int_equal(tctx, *r.out.authoritative, 1, "LogonSamLogon invalid *r.out.authoritative"); @@ -1091,7 +1090,7 @@ static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context "LogonSamLogon expected INVALID_PARAMETER"); torture_assert(tctx, - memcmp(&auth2, &auth_zero, sizeof(auth2)) == 0, + all_zero((uint8_t *)&auth2, sizeof(auth2)), "Return authenticator non zero"); torture_assert_int_equal(tctx, *r.out.authoritative, 1, "LogonSamLogon invalid *r.out.authoritative"); -- 2.47.2