torture-netlogon: Use "all_zero" where appropriate
authorVolker Lendecke <vl@samba.org>
Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)
committerRalph Boehme <slow@samba.org>
Tue, 3 Jan 2017 18:56:17 +0000 (19:56 +0100)
... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jan  3 19:56:17 CET 2017 on sn-devel-144

source4/torture/rpc/netlogon.c

index 1d24f07858c94b5e2f7144886e70c504c103884e..455fce611aed8f3296d6bec83443c3e4571576b6 100644 (file)
@@ -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");