array: Number of items in get_size() is unsigned
[strongswan.git] / src / libstrongswan / collections / linked_list.c
index 274ad8e..a176e5a 100644 (file)
@@ -138,7 +138,10 @@ METHOD(enumerator_t, enumerate, bool,
                this->finished = TRUE;
                return FALSE;
        }
-       *item = this->current->value;
+       if (item)
+       {
+               *item = this->current->value;
+       }
        return TRUE;
 }
 
@@ -165,16 +168,6 @@ METHOD(linked_list_t, reset_enumerator, void,
        enumerator->finished = FALSE;
 }
 
-METHOD(linked_list_t, has_more, bool,
-       private_linked_list_t *this, private_enumerator_t *enumerator)
-{
-       if (enumerator->current)
-       {
-               return enumerator->current->next != NULL;
-       }
-       return !enumerator->finished && this->first != NULL;
-}
-
 METHOD(linked_list_t, get_count, int,
        private_linked_list_t *this)
 {
@@ -497,7 +490,6 @@ linked_list_t *linked_list_create()
                        .get_count = _get_count,
                        .create_enumerator = _create_enumerator,
                        .reset_enumerator = (void*)_reset_enumerator,
-                       .has_more = (void*)_has_more,
                        .get_first = _get_first,
                        .get_last = _get_last,
                        .find_first = (void*)_find_first,