summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-17 00:22:12 +0100
committerMichael Adam <obnox@samba.org>2008-03-17 08:22:32 +0100
commita37811727a32b9f5752321cf0c8533c314aebd5f (patch)
tree3c3431c8242b263a3815fba77e992a5036fcb571 /source3/registry
parenta446378e7aa45af797901687ca10b81da1f1b5f3 (diff)
downloadsamba-a37811727a32b9f5752321cf0c8533c314aebd5f.tar.gz
samba-a37811727a32b9f5752321cf0c8533c314aebd5f.tar.bz2
samba-a37811727a32b9f5752321cf0c8533c314aebd5f.zip
registry: reformat regdb_store_keys_internal(), killing long lines.
Michael (This used to be commit 966b2414cb6efdfe5acb412ed9bdfd7589ee694c)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 0ef76fe82f..f91ddb7d8c 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -401,7 +401,8 @@ static bool regdb_store_keys_internal(const char *key, REGSUBKEY_CTR *ctr)
/* allocate some initial memory */
- if (!(buffer = (uint8 *)SMB_MALLOC(1024))) {
+ buffer = (uint8 *)SMB_MALLOC(1024);
+ if (buffer == NULL) {
return false;
}
buflen = 1024;
@@ -409,22 +410,25 @@ static bool regdb_store_keys_internal(const char *key, REGSUBKEY_CTR *ctr)
/* store the number of subkeys */
- len += tdb_pack(buffer+len, buflen-len, "d", num_subkeys );
+ len += tdb_pack(buffer+len, buflen-len, "d", num_subkeys);
/* pack all the strings */
for (i=0; i<num_subkeys; i++) {
- len += tdb_pack( buffer+len, buflen-len, "f", regsubkey_ctr_specific_key(ctr, i) );
- if ( len > buflen ) {
+ len += tdb_pack(buffer+len, buflen-len, "f",
+ regsubkey_ctr_specific_key(ctr, i));
+ if (len > buflen) {
/* allocate some extra space */
- if ((buffer = (uint8 *)SMB_REALLOC( buffer, len*2 )) == NULL) {
- DEBUG(0,("regdb_store_keys: Failed to realloc memory of size [%d]\n", len*2));
+ buffer = (uint8 *)SMB_REALLOC(buffer, len*2);
+ if(buffer == NULL) {
+ DEBUG(0, ("regdb_store_keys: Failed to realloc "
+ "memory of size [%d]\n", len*2));
ret = false;
goto done;
}
buflen = len*2;
-
- len = tdb_pack( buffer+len, buflen-len, "f", regsubkey_ctr_specific_key(ctr, i) );
+ len = tdb_pack(buffer+len, buflen-len, "f",
+ regsubkey_ctr_specific_key(ctr, i));
}
}
@@ -440,7 +444,7 @@ static bool regdb_store_keys_internal(const char *key, REGSUBKEY_CTR *ctr)
done:
TALLOC_FREE(ctx);
- SAFE_FREE( buffer );
+ SAFE_FREE(buffer);
return ret;
}