summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-04 15:06:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:12 -0500
commit8f9e87d858ae1cf2209cfd8332ad54a750252e24 (patch)
treed5a873ccebb07d034991135085eb0856c190549e /source4/lib/ldb
parent637ba7f7e6514cdf9c553ffd4f87ed5c7af1df4e (diff)
downloadsamba-8f9e87d858ae1cf2209cfd8332ad54a750252e24.tar.gz
samba-8f9e87d858ae1cf2209cfd8332ad54a750252e24.tar.bz2
samba-8f9e87d858ae1cf2209cfd8332ad54a750252e24.zip
r8146: fix compiler warning
metze (This used to be commit 5fcaa21d67e399aab4af15f4f6f919203c1152e5)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 7556a144e2..1eaf4c486b 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -361,22 +361,20 @@ failed:
char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *edn)
{
char *dn, *value;
- const char *format = "%s=%s";
int i;
dn = talloc_strdup(mem_ctx, "");
LDB_DN_NULL_FAILED(dn);
for (i = 0; i < edn->comp_num; i++) {
-
- if (i != 0) {
- format = ",%s=%s";
- }
-
value = ldb_dn_escape_value(dn, edn->components[i].value);
LDB_DN_NULL_FAILED(value);
- dn = talloc_asprintf_append(dn, format, edn->components[i].name, value);
+ if (i == 0) {
+ dn = talloc_asprintf_append(dn, "%s=%s", edn->components[i].name, value);
+ } else {
+ dn = talloc_asprintf_append(dn, ",%s=%s", edn->components[i].name, value);
+ }
LDB_DN_NULL_FAILED(dn);
talloc_free(value);