summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index f76c3441e7..bb314fbe40 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -1268,9 +1268,9 @@ static char *ldb_dn_canonical(void *mem_ctx, struct ldb_dn *dn, int ex_format) {
/* Only domain components? Finish here */
if (i < 0) {
if (ex_format) {
- cracked = talloc_asprintf(tmpctx, "%s\n", cracked);
+ cracked = talloc_append_string(tmpctx, cracked, "\n");
} else {
- cracked = talloc_asprintf(tmpctx, "%s/", cracked);
+ cracked = talloc_append_string(tmpctx, cracked, "/");
}
talloc_steal(mem_ctx, cracked);
goto done;
@@ -1278,7 +1278,7 @@ static char *ldb_dn_canonical(void *mem_ctx, struct ldb_dn *dn, int ex_format) {
/* Now walk backwards appending remaining components */
for (; i > 0; i--) {
- cracked = talloc_asprintf(tmpctx, "%s/%s", cracked,
+ cracked = talloc_asprintf_append(cracked, "/%s",
ldb_dn_escape_value(tmpctx, dn->components[i].value));
if (!cracked) {
goto done;
@@ -1287,10 +1287,10 @@ static char *ldb_dn_canonical(void *mem_ctx, struct ldb_dn *dn, int ex_format) {
/* Last one, possibly a newline for the 'ex' format */
if (ex_format) {
- cracked = talloc_asprintf(tmpctx, "%s\n%s", cracked,
+ cracked = talloc_asprintf_append(cracked, "\n%s",
ldb_dn_escape_value(tmpctx, dn->components[i].value));
} else {
- cracked = talloc_asprintf(tmpctx, "%s/%s", cracked,
+ cracked = talloc_asprintf_append(cracked, "/%s",
ldb_dn_escape_value(tmpctx, dn->components[i].value));
}