From: Volker Lendecke Date: Sat, 31 Dec 2016 12:45:51 +0000 (+0000) Subject: torture-netlogon: Use "all_zero" where appropriate X-Git-Tag: samba-4.6.0rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98bcdca632c7e508af2ecb3e8d6e005d04523c83;p=thirdparty%2Fsamba.git torture-netlogon: Use "all_zero" where appropriate ... 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 --- 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");