diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-03-20 17:32:39 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-03-20 05:26:18 +0000 |
commit | acbf103fcaa4150a57bfbab2450e36b5b39e399b (patch) | |
tree | 76ff8847b5a1ad831682658de09371c9f9e8ab3b /source3/registry | |
parent | 601afd690346087fbd53819dba9b1afa81560064 (diff) | |
download | samba-acbf103fcaa4150a57bfbab2450e36b5b39e399b.tar.gz |
regfio: Update code near recent changes to match README.Coding
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>
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/regfio.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index 33b24489e97..32e166a1223 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -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; |