regfio: Update code near recent changes to match README.Coding
authorAndrew Bartlett <abartlet@samba.org>
Wed, 20 Mar 2019 04:32:39 +0000 (17:32 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Mar 2019 05:26:18 +0000 (05:26 +0000)
This file long predates our current code conventions.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13840

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/registry/regfio.c

index 33b24489e973de4aff112ec1bba2637ed4adf32b..32e166a122304bd1dabf677a514150165a73e31f 100644 (file)
@@ -1127,16 +1127,16 @@ static bool next_record( REGF_HBIN *hbin, const char *hdr, bool *eob )
                if ( !prs_uint8s( True, "header", ps, 0, header, REC_HDR_SIZE ) )
                        return False;
 
-               if ( record_size & 0x80000000 ) {
+               if (record_size & 0x80000000) {
                        /* absolute_value(record_size) */
                        record_size = (record_size ^ 0xffffffff) + 1;
                }
 
-               if ( record_size < sizeof(REC_HDR_SIZE) ) {
-                       return False;
+               if (record_size < sizeof(REC_HDR_SIZE)) {
+                       return false;
                }
 
-               if ( memcmp( header, hdr, REC_HDR_SIZE ) == 0 ) {
+               if (memcmp(header, hdr, REC_HDR_SIZE) == 0) {
                        found = True;
                        curr_off += sizeof(uint32_t);
                }
@@ -1437,13 +1437,19 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file )
 
        /* see if there is anything left to report */
        
-       if ( !nk || !nk->subkeys.hashes || nk->subkey_index >= nk->subkeys.num_keys ||
-            (nk->subkeys_off==REGF_OFFSET_NONE) || (nk->subkey_index >= nk->num_subkeys) )
+       if (nk == NULL ||
+           nk->subkeys.hashes == NULL ||
+           nk->subkey_index >= nk->subkeys.num_keys ||
+           (nk->subkeys_off == REGF_OFFSET_NONE) ||
+           (nk->subkey_index >= nk->num_subkeys)) {
                return NULL;
+       }
 
        /* find the HBIN block which should contain the nk record */
-       
-       if ( !(hbin = lookup_hbin_block( file, nk->subkeys.hashes[nk->subkey_index].nk_off )) ) {
+
+       hbin = lookup_hbin_block(file,
+                                nk->subkeys.hashes[nk->subkey_index].nk_off);
+       if (hbin == NULL) {
                DEBUG(0,("hbin_prs_key: Failed to find HBIN block containing offset [0x%x]\n", 
                        nk->subkeys.hashes[nk->subkey_index].nk_off));
                return NULL;