Add missing NULL test.

This commit is contained in:
Andreas Schneider 2008-05-20 12:05:27 +02:00
parent b54cb0fd66
commit 49c4ad76e1

View file

@ -323,6 +323,10 @@ c_list_t *c_list_last(c_list_t *list) {
* Gets the element at the given positon in a c_list
*/
c_list_t *c_list_position(c_list_t *list, long position) {
if (list == NULL) {
return NULL;
}
while ((position-- > 0) && list != NULL) {
list = list->next;
}