overwrite stored names & link keys if no place remained

This commit is contained in:
mila@ringwald.ch 2011-11-15 13:33:13 +00:00
parent 31b7540338
commit 32046991c1

View File

@ -36,7 +36,7 @@
*/
#include <btstack/linked_list.h>
#include <stdlib.h>
/**
* tests if list is empty
*/
@ -44,6 +44,21 @@ int linked_list_empty(linked_list_t * list){
return *list == (void *) 0;
}
/**
* linked_list_get_last_item
*/
linked_item_t * linked_list_get_last_item(linked_list_t * list){ // <-- find the last item in the list
linked_item_t *lastItem = NULL;
linked_item_t *it;
for (it = *list; it ; it = it->next){
if (it) {
lastItem = it;
}
}
return lastItem;
}
/**
* linked_list_add
*/