summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-16 14:47:42 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-16 14:57:52 +0200
commit19e94349b3bf3ba605cb5fde3fca9fe12bfe74d9 (patch)
treeaa8f79e0153c8d5dac88d80b508999d52b5d5fb8 /source4/lib
parentbc0294814af8dd2756191c8df74bb8db0fe61319 (diff)
downloadsamba-19e94349b3bf3ba605cb5fde3fca9fe12bfe74d9.tar.gz
samba-19e94349b3bf3ba605cb5fde3fca9fe12bfe74d9.tar.bz2
samba-19e94349b3bf3ba605cb5fde3fca9fe12bfe74d9.zip
ldb:"ldb_dn_canonical" - use an "unsigned int" counter
Convert it to use an "unsigned int" counter which represents the exact length of the DN components.
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 9bbefddb8e..2b640687b1 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -1711,7 +1711,7 @@ struct ldb_dn *ldb_dn_get_parent(TALLOC_CTX *mem_ctx, struct ldb_dn *dn)
*/
static char *ldb_dn_canonical(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int ex_format) {
- long long int i;
+ unsigned int i;
TALLOC_CTX *tmpctx;
char *cracked = NULL;
const char *format = (ex_format ? "\n" : "/" );
@@ -1723,7 +1723,7 @@ static char *ldb_dn_canonical(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int ex_for
tmpctx = talloc_new(mem_ctx);
/* Walk backwards down the DN, grabbing 'dc' components at first */
- for (i = dn->comp_num - 1; i >= 0; i--) {
+ for (i = dn->comp_num - 1; i != (unsigned int) -1; i--) {
if (ldb_attr_cmp(dn->components[i].name, "dc") != 0) {
break;
}
@@ -1742,7 +1742,7 @@ static char *ldb_dn_canonical(TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int ex_for
}
/* Only domain components? Finish here */
- if (i < 0) {
+ if (i == (unsigned int) -1) {
cracked = talloc_strdup_append_buffer(cracked, format);
talloc_steal(mem_ctx, cracked);
goto done;