summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-16 15:04:57 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-16 15:04:57 +0200
commit1557acb44af8c43ceafa5516915f7107e169f190 (patch)
treed7306fdf4a71b9b926c62dd956a27189c36f47fe /source4/lib
parent19e94349b3bf3ba605cb5fde3fca9fe12bfe74d9 (diff)
downloadsamba-1557acb44af8c43ceafa5516915f7107e169f190.tar.gz
samba-1557acb44af8c43ceafa5516915f7107e169f190.tar.bz2
samba-1557acb44af8c43ceafa5516915f7107e169f190.zip
ldb:"ldb_dn_remove_base_components" - use an "unsigned int" counter
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/common/ldb_dn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index 2b640687b1..cb680e2e93 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -1600,7 +1600,7 @@ bool ldb_dn_add_child_fmt(struct ldb_dn *dn, const char *child_fmt, ...)
bool ldb_dn_remove_base_components(struct ldb_dn *dn, unsigned int num)
{
- long long int i;
+ unsigned int i;
if ( ! ldb_dn_validate(dn)) {
return false;
@@ -1611,11 +1611,11 @@ bool ldb_dn_remove_base_components(struct ldb_dn *dn, unsigned int num)
}
/* free components */
- for (i = num; i > 0; i--) {
- LDB_FREE(dn->components[dn->comp_num - i].name);
- LDB_FREE(dn->components[dn->comp_num - i].value.data);
- LDB_FREE(dn->components[dn->comp_num - i].cf_name);
- LDB_FREE(dn->components[dn->comp_num - i].cf_value.data);
+ for (i = dn->comp_num - num; i < dn->comp_num; i++) {
+ LDB_FREE(dn->components[i].name);
+ LDB_FREE(dn->components[i].value.data);
+ LDB_FREE(dn->components[i].cf_name);
+ LDB_FREE(dn->components[i].cf_value.data);
}
dn->comp_num -= num;