git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67b88e4
)
r19910: Make better use of our set of talloc utility functions
author
Simo Sorce
<idra@samba.org>
Sun, 26 Nov 2006 21:50:24 +0000
(21:50 +0000)
committer
Gerald (Jerry) Carter
<jerry@samba.org>
Wed, 10 Oct 2007 19:28:35 +0000
(14:28 -0500)
source/lib/ldb/common/ldb_dn.c
patch
|
blob
|
history
diff --git
a/source/lib/ldb/common/ldb_dn.c
b/source/lib/ldb/common/ldb_dn.c
index f76c3441e71e3d90279d35e1635971400a7f9d33..bb314fbe40ba2983fb52123a7e0e6a28493d8464 100644
(file)
--- a/
source/lib/ldb/common/ldb_dn.c
+++ b/
source/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) {
/* Only domain components? Finish here */
if (i < 0) {
if (ex_format) {
- cracked = talloc_a
sprintf(tmpctx, "%s\n", cracked
);
+ cracked = talloc_a
ppend_string(tmpctx, cracked, "\n"
);
} else {
} else {
- cracked = talloc_a
sprintf(tmpctx, "%s/", cracked
);
+ cracked = talloc_a
ppend_string(tmpctx, cracked, "/"
);
}
talloc_steal(mem_ctx, cracked);
goto done;
}
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--) {
/* 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;
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) {
/* 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 {
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));
}
ldb_dn_escape_value(tmpctx, dn->components[i].value));
}