From 5a54b204c3d2b6c9282cdd459a3d1030fde48926 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 6 Nov 2009 20:14:41 +0100 Subject: s4:schema - Change also here counters to "unsigned" where needed Counters which are used in the way "for (i = 0; array[i] != NULL; i++)" I modified to "unsigned" since for sure we don't want to have negative array indexes there. --- source4/dsdb/schema/schema_query.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/dsdb/schema/schema_query.c') diff --git a/source4/dsdb/schema/schema_query.c b/source4/dsdb/schema/schema_query.c index ff54488251..4ff84185f8 100644 --- a/source4/dsdb/schema/schema_query.c +++ b/source4/dsdb/schema/schema_query.c @@ -219,7 +219,7 @@ WERROR dsdb_linked_attribute_lDAPDisplayName_list(const struct dsdb_schema *sche { const char **attr_list = NULL; struct dsdb_attribute *cur; - int i = 0; + unsigned int i = 0; for (cur = schema->attributes; cur; cur = cur->next) { if (cur->linkID == 0) continue; @@ -239,7 +239,7 @@ const char **merge_attr_list(TALLOC_CTX *mem_ctx, const char **attrs, const char * const*new_attrs) { const char **ret_attrs; - int i; + unsigned int i; size_t new_len, orig_len = str_list_length(attrs); if (!new_attrs) { return attrs; @@ -339,7 +339,7 @@ static const char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx, const char **class_list, enum dsdb_attr_list_query query) { - int i; + unsigned int i; const char **attr_list = NULL; for (i=0; class_list && class_list[i]; i++) { @@ -366,7 +366,7 @@ static const char **dsdb_full_attribute_list_internal_el(TALLOC_CTX *mem_ctx, const struct ldb_message_element *el, enum dsdb_attr_list_query query) { - int i; + unsigned int i; const char **attr_list = NULL; for (i=0; i < el->num_values; i++) { @@ -391,10 +391,10 @@ static const char **dedup_attr_list(const char **attr_list) size_t new_len = str_list_length(attr_list); /* Remove duplicates */ if (new_len > 1) { - int i; + size_t i; TYPESAFE_QSORT(attr_list, new_len, qsort_string); - for (i=1 ; i < new_len; i++) { + for (i=1; i < new_len; i++) { const char **val1 = &attr_list[i-1]; const char **val2 = &attr_list[i]; if (ldb_attr_cmp(*val1, *val2) == 0) { -- cgit