From abe75a5c8c42a15927ae4f4fb3ff69aef1569d1e Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 16 Mar 2010 09:40:11 +0100 Subject: s4:registry - use a macro for reverse byte order --- source4/lib/registry/ldb.c | 7 ++----- source4/lib/registry/util.c | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index 83905f3e715..a86dacd34b6 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -231,11 +231,8 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, conv_str = talloc_asprintf(msg, "0x%8.8x", IVAL(data.data, 0)); } else { - conv_str = talloc_asprintf(msg, "0x%2.2x%2.2x%2.2x%2.2x", - CVAL(data.data, 0), - CVAL(data.data, 1), - CVAL(data.data, 2), - CVAL(data.data, 3)); + conv_str = talloc_asprintf(msg, "0x%8.8x", + RIVAL(data.data, 0)); } if (conv_str == NULL) { diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index 56212906ded..7afca628134 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -91,11 +91,8 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx, ret = talloc_asprintf(mem_ctx, "0x%8.8x", IVAL(data.data, 0)); } else { - ret = talloc_asprintf(mem_ctx, "0x%2.2x%2.2x%2.2x%2.2x", - CVAL(data.data, 0), - CVAL(data.data, 1), - CVAL(data.data, 2), - CVAL(data.data, 3)); + ret = talloc_asprintf(mem_ctx, "0x%8.8x", + RIVAL(data.data, 0)); } } break; -- cgit