From: hackbard Date: Mon, 8 Nov 2004 11:03:51 +0000 (+0000) Subject: list_next returns L_NO_NEXT_ELEMENT when at end of list X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=6cf9bd920bfff6aac1b7eb63e7bf9b036fbd7486;p=my-code%2Fapi.git list_next returns L_NO_NEXT_ELEMENT when at end of list --- diff --git a/list/list.c b/list/list.c index 664dd00..d5cf54b 100644 --- a/list/list.c +++ b/list/list.c @@ -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;