summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-11-26 21:50:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:35 -0500
commit921a596cd47c5ecdf40e9dea1754227418e9e13f (patch)
treecedc1e6c33688b3f4ba23b38c661ede3bdb444d5 /source4/lib/ldb
parent8ec78bcbbf38963f69a7f81afee438eb08d55b52 (diff)
downloadsamba-921a596cd47c5ecdf40e9dea1754227418e9e13f.tar.gz
samba-921a596cd47c5ecdf40e9dea1754227418e9e13f.tar.bz2
samba-921a596cd47c5ecdf40e9dea1754227418e9e13f.zip
r19910: Make better use of our set of talloc utility functions
(This used to be commit b1197dbeebff062b8ea1e8466d436be82b0b61e0)
Diffstat (limited to 'source4/lib/ldb')
-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));
}