summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2003-04-19 18:36:54 +0000
committerRichard Sharpe <sharpe@samba.org>2003-04-19 18:36:54 +0000
commitef423a45209562436c83925b9dabb2aadb4ab72b (patch)
treea5b8a90e886e7092bab338362831484131703bd8
parente02a3f233611bb358a960822a83b4d1ad45eca13 (diff)
downloadsamba-ef423a45209562436c83925b9dabb2aadb4ab72b.tar.gz
samba-ef423a45209562436c83925b9dabb2aadb4ab72b.tar.bz2
samba-ef423a45209562436c83925b9dabb2aadb4ab72b.zip
Squelch some warnings, and move a bit of code around to make some future
things easier ... now on to more functionality. Hope Jerry fixes the breakage, BTW :-) (This used to be commit c7d39a7426e5970b15ece89737d2f0ba3d5c0835)
-rw-r--r--source3/utils/editreg.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source3/utils/editreg.c b/source3/utils/editreg.c
index 1b7b3d587d..d98076d8f9 100644
--- a/source3/utils/editreg.c
+++ b/source3/utils/editreg.c
@@ -1264,12 +1264,6 @@ int nt_free_regf(REGF *regf)
if (regf->regfile_name) free(regf->regfile_name);
if (regf->outfile_name) free(regf->outfile_name);
- /* Free the mmap'd area */
-
- if (regf->base) munmap(regf->base, regf->sbuf.st_size);
- regf->base = NULL;
- close(regf->fd); /* Ignore the error :-) */
-
nt_delete_reg_key(regf->root, False); /* Free the tree */
free(regf->sk_map);
regf->sk_count = regf->sk_map_size = 0;
@@ -1892,7 +1886,7 @@ REG_KEY *nt_get_key_tree(REGF *regf, NK_HDR *nk_hdr, int size, REG_KEY *parent)
own = (REG_KEY *)LOCN(regf->base, own_off);
if (verbose) fprintf(stdout, " Owner offset: %0X, Our Offset: %0X\n",
- own, nk_hdr);
+ (unsigned int)own, (unsigned int)nk_hdr);
/*
* We should verify that the owner field is correct ...
@@ -2017,6 +2011,15 @@ int nt_load_registry(REGF *regf)
assert(regf->root != NULL);
+ /*
+ * Unmap the registry file, as we might want to read in another
+ * tree etc.
+ */
+
+ if (regf->base) munmap(regf->base, regf->sbuf.st_size);
+ regf->base = NULL;
+ close(regf->fd); /* Ignore the error :-) */
+
return 1;
}
@@ -2504,7 +2507,7 @@ CMD *regedit4_get_cmd(int fd)
cmd->cmd = CMD_NONE;
cmd->key = NULL;
cmd->val_spec_list = cmd->val_spec_last = NULL;
- while (cl = get_cmd_line(fd)) {
+ while ((cl = get_cmd_line(fd))) {
strip_comment(cl); /* remove anything beyond a comment char */
trim_trailing_spaces(cl);