From: hackbard Date: Fri, 10 Jun 2005 16:06:55 +0000 (+0000) Subject: point to added list element in case after adding an element X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbb174b5acb9d83fba8fdbd29f4a4426f152bd7e;p=my-code%2Fapi.git point to added list element in case after adding an element --- diff --git a/list/list.c b/list/list.c index 0cfb441..64a104a 100644 --- a/list/list.c +++ b/list/list.c @@ -123,6 +123,8 @@ int list_add_element(t_list *list,void *data,int data_len) { memcpy(list->current->next->data,data,data_len); list->current->next->data_len=data_len; + list->current=list->current->next; + dprintf(list->outfd,"[list] element added\n"); return L_SUCCESS; @@ -145,6 +147,8 @@ int list_add_element(t_list *list,void *data,int data_len) { list->start->next=NULL; list->start->prev=NULL; + list->current=list->start; + dprintf(list->outfd,"[list] added initial element\n"); return L_SUCCESS;