]> hackdaworld.org Git - my-code/api.git/commitdiff
list_next returns L_NO_NEXT_ELEMENT when at end of list
authorhackbard <hackbard>
Mon, 8 Nov 2004 11:03:51 +0000 (11:03 +0000)
committerhackbard <hackbard>
Mon, 8 Nov 2004 11:03:51 +0000 (11:03 +0000)
list/list.c

index 664dd001ab911d66566edb4a6b85492d8bf634cf..d5cf54b6734d6d90fd09f8468133a87a2a503c29 100644 (file)
@@ -28,6 +28,8 @@ int list_shutdown(t_list *list) {
 
 int list_next(t_list *list) {
 
+  if(list->current->next==NULL) return L_NO_NEXT_ELEMENT;
+
   list->current=list->current->next;
 
   return L_SUCCESS;