From 921a596cd47c5ecdf40e9dea1754227418e9e13f Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 26 Nov 2006 21:50:24 +0000 Subject: r19910: Make better use of our set of talloc utility functions (This used to be commit b1197dbeebff062b8ea1e8466d436be82b0b61e0) --- source4/lib/ldb/common/ldb_dn.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/lib/ldb/common/ldb_dn.c') 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)); } -- cgit