summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/ldb.c10
-rw-r--r--source4/lib/registry/tests/generic.c2
-rw-r--r--source4/lib/registry/util.c9
3 files changed, 5 insertions, 16 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 4dff5e3987..b21ca8e27b 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -228,14 +228,8 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
if (data.length == sizeof(uint32_t)) {
char *conv_str;
- if (type == REG_DWORD) {
- conv_str = talloc_asprintf(msg, "0x%8.8x",
- IVAL(data.data, 0));
- } else {
- conv_str = talloc_asprintf(msg, "0x%8.8x",
- RIVAL(data.data, 0));
- }
-
+ conv_str = talloc_asprintf(msg, "0x%8.8x",
+ IVAL(data.data, 0));
if (conv_str == NULL) {
talloc_free(msg);
return NULL;
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index 1e8effa7e9..206fad0d41 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -74,7 +74,7 @@ static bool test_reg_val_data_string_dword_big_endian(struct torture_context *ct
{
uint32_t d = 0x20;
DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
- torture_assert_str_equal(ctx, "0x20000000",
+ torture_assert_str_equal(ctx, "0x00000020",
reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD_BIG_ENDIAN, db),
"dword failed");
return true;
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index 7afca62813..3c1289956d 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -87,13 +87,8 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
case REG_DWORD:
case REG_DWORD_BIG_ENDIAN:
if (data.length == sizeof(uint32_t)) {
- if (type == REG_DWORD) {
- ret = talloc_asprintf(mem_ctx, "0x%8.8x",
- IVAL(data.data, 0));
- } else {
- ret = talloc_asprintf(mem_ctx, "0x%8.8x",
- RIVAL(data.data, 0));
- }
+ ret = talloc_asprintf(mem_ctx, "0x%8.8x",
+ IVAL(data.data, 0));
}
break;
case REG_QWORD: