mirror of
https://github.com/samba-team/samba.git
synced 2025-01-15 23:24:37 +03:00
r8146: fix compiler warning
metze (This used to be commit 5fcaa21d67e399aab4af15f4f6f919203c1152e5)
This commit is contained in:
parent
637ba7f7e6
commit
8f9e87d858
@ -361,22 +361,20 @@ failed:
|
|||||||
char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *edn)
|
char *ldb_dn_linearize(void *mem_ctx, const struct ldb_dn *edn)
|
||||||
{
|
{
|
||||||
char *dn, *value;
|
char *dn, *value;
|
||||||
const char *format = "%s=%s";
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dn = talloc_strdup(mem_ctx, "");
|
dn = talloc_strdup(mem_ctx, "");
|
||||||
LDB_DN_NULL_FAILED(dn);
|
LDB_DN_NULL_FAILED(dn);
|
||||||
|
|
||||||
for (i = 0; i < edn->comp_num; i++) {
|
for (i = 0; i < edn->comp_num; i++) {
|
||||||
|
|
||||||
if (i != 0) {
|
|
||||||
format = ",%s=%s";
|
|
||||||
}
|
|
||||||
|
|
||||||
value = ldb_dn_escape_value(dn, edn->components[i].value);
|
value = ldb_dn_escape_value(dn, edn->components[i].value);
|
||||||
LDB_DN_NULL_FAILED(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);
|
LDB_DN_NULL_FAILED(dn);
|
||||||
|
|
||||||
talloc_free(value);
|
talloc_free(value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user