s4:proxy LDB module - Change counter variables to "unsigned" where appropriate
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 7 Mar 2010 18:13:11 +0000 (19:13 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 7 Mar 2010 18:19:26 +0000 (19:19 +0100)
Use "size_t" when counting string index positions.

source4/dsdb/samdb/ldb_modules/proxy.c

index 87b1a6e1b63adfd0dc2583de8a1da67fc34d0325..616563e2d0e9792124245910a693626c3d2ecc09 100644 (file)
@@ -165,7 +165,7 @@ failed:
 static void proxy_convert_blob(TALLOC_CTX *mem_ctx, struct ldb_val *v,
                               const char *oldstr, const char *newstr)
 {
-       int len1, len2, len3;
+       size_t len1, len2, len3;
        uint8_t *olddata = v->data;
        char *p = strcasestr((char *)v->data, oldstr);
 
@@ -184,7 +184,7 @@ static void proxy_convert_blob(TALLOC_CTX *mem_ctx, struct ldb_val *v,
 */
 static void proxy_convert_value(struct proxy_data *proxy, struct ldb_message *msg, struct ldb_val *v)
 {
-       int i;
+       size_t i;
 
        for (i=0;proxy->oldstr[i];i++) {
                char *p = strcasestr((char *)v->data, proxy->oldstr[i]);
@@ -201,7 +201,7 @@ static struct ldb_parse_tree *proxy_convert_tree(TALLOC_CTX *mem_ctx,
                                                 struct proxy_data *proxy,
                                                 struct ldb_parse_tree *tree)
 {
-       int i;
+       size_t i;
        char *expression = ldb_filter_from_tree(mem_ctx, tree);
 
        for (i=0;proxy->newstr[i];i++) {
@@ -225,7 +225,7 @@ static void proxy_convert_record(struct ldb_context *ldb,
                                 struct proxy_data *proxy,
                                 struct ldb_message *msg)
 {
-       int attr, v;
+       unsigned int attr, v;
 
        /* fix the message DN */
        if (ldb_dn_compare_base(proxy->olddn, msg->dn) == 0) {
@@ -307,7 +307,8 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
        struct proxy_data *proxy = talloc_get_type(ldb_module_get_private(module), struct proxy_data);
        struct ldb_request *newreq;
        struct ldb_dn *base;
-       int ret, i;
+       unsigned int i;
+       int ret;
 
        ldb = ldb_module_get_ctx(module);