]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tdb: Use explicit initialization
authorVolker Lendecke <vl@samba.org>
Mon, 22 Oct 2018 05:08:58 +0000 (07:08 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 25 Oct 2018 15:58:23 +0000 (17:58 +0200)
Let the compiler figure out the optimal code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/tdb/common/open.c

index 44bb3a0009f783d09613cd892eab9dfa0c71f880..899a2fcaffbd9d073efe69fb55913b43c75d719e 100644 (file)
@@ -297,7 +297,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
                                tdb_hash_func hash_fn)
 {
        int orig_errno = errno;
-       struct tdb_header header;
+       struct tdb_header header = {{0}};
        struct tdb_context *tdb;
        struct stat st;
        int rev = 0;
@@ -309,8 +309,6 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
        uint32_t magic1, magic2;
        int ret;
 
-       ZERO_STRUCT(header);
-
        if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) {
                /* Can't log this */
                errno = ENOMEM;