ldb:"ldb_dn_add_child" - use "unsigned int" counters
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 16 Oct 2010 13:08:40 +0000 (15:08 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 16 Oct 2010 13:11:45 +0000 (15:11 +0200)
source4/lib/ldb/common/ldb_dn.c

index cb680e2e9332a55b1dd7435c8b4d9254970bda7d..885433f3e5ced8f12d5fe43e59edb64341d9991f 100644 (file)
@@ -1486,7 +1486,7 @@ bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
 
        if (dn->components) {
                unsigned int n;
-               long long int i, j;
+               unsigned int i, j;
 
                if (dn->comp_num == 0) {
                        return false;
@@ -1514,7 +1514,8 @@ bool ldb_dn_add_child(struct ldb_dn *dn, struct ldb_dn *child)
                        return false;
                }
 
-               for (i = dn->comp_num - 1, j = n - 1; i >= 0; i--, j--) {
+               for (i = dn->comp_num - 1, j = n - 1; i != (unsigned int) -1;
+                    i--, j--) {
                        dn->components[j] = dn->components[i];
                }